Skip to main content
Associate III
August 19, 2024
Question

qt aplication problem: Failed to create wl_display

  • August 19, 2024
  • 1 reply
  • 10950 views

Hello @Erwan SZYMANSKI 

I hope your week started well.

I think the script didn’t work because I couldn't adjust the paths correctly. Could you please assist me in finding the correct paths and adjusting my script accordingly?

 

 

 

 

# !/bin/sh

export QSG_INFO=1
export QML2_IMPORT_PATH=~/imports/
export PATH=/usr/local/qt5-install/bin/:/usr/local/apitrace/bin:$PATH
export QT_QPA_PLATFORM=wayland

#Execute the Qt program
export XDG_RUNTIME_SESSION=wayland; export XDG_RUNTIME_DIR=/run/user/1000; export WAYLAND_DISPLAY=wayland-1; cd /usr/bin && ./automotive
nesnes@nesnes-ABRA-A5-V19-2:/usr/local$ tree -L 2
.
├── bin
├── etc
├── games
├── include
├── lib
│ └── python3.10
├── man -> share/man
├── sbin
├── share
│ ├── ca-certificates
│ ├── fonts
│ ├── man
│ ├── sgml
│ ├── texmf
│ └── xml
└── src

 

 

 

 

1 reply

nesnesAuthor
Associate III
August 19, 2024

@Erwan SZYMANSKI   I think it is on x11 as a default so I want to try that how can I do the adjustments for that

 

root@stm32mp15-disco:~# automotive 
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

Aborted (core dumped)
root@stm32mp15-disco:~# run_automotive 
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

Aborted (core dumped)

I run this command

root@stm32mp15-disco:~# export QT_DEBUG_PLUGINS=1
root@stm32mp15-disco:~# export QT_DEBUG_PLUGINS=1
root@stm32mp15-disco:~# run_automotive 
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/plugins/platforms/libqeglfs.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "eglfs"
 ]
 },
 "archreq": 0,
 "className": "QEglFSIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/plugins/platforms/libqminimal.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "minimal"
 ]
 },
 "archreq": 0,
 "className": "QMinimalIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/plugins/platforms/libqminimalegl.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "minimalegl"
 ]
 },
 "archreq": 0,
 "className": "QMinimalEglIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/plugins/platforms/libqoffscreen.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "offscreen"
 ]
 },
 "archreq": 0,
 "className": "QOffscreenIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/plugins/platforms/libqvnc.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "vnc"
 ]
 },
 "archreq": 0,
 "className": "QVncIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqwayland-egl.so"
Found metadata in lib /usr/lib/plugins/platforms/libqwayland-egl.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "wayland-egl"
 ]
 },
 "archreq": 0,
 "className": "QWaylandEglPlatformIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("wayland-egl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/platforms/libqwayland-generic.so"
Found metadata in lib /usr/lib/plugins/platforms/libqwayland-generic.so, metadata=
{
 "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
 "MetaData": {
 "Keys": [
 "wayland"
 ]
 },
 "archreq": 0,
 "className": "QWaylandIntegrationPlugin",
 "debug": false,
 "version": 331520
}


Got keys from plugin meta data ("wayland")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
loaded library "/usr/lib/plugins/platforms/libqwayland-generic.so"
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

Aborted (core dumped)

 

nesnesAuthor
Associate III
August 20, 2024

@Erwan SZYMANSKI  I couldn't fix the issue can you help me solve it

root@stm32mp15-disco:~# ls /usr/lib/qml/QtQuick/Layouts/
libqquicklayoutsplugin.so plugins.qmltypes qmldir
root@stm32mp15-disco:~# chmod 755 /usr/lib/qml/QtQuick/Layouts/libqtquicklayoutsplugin.so
chmod: cannot access '/usr/lib/qml/QtQuick/Layouts/libqtquicklayoutsplugin.so': No such file or directory
root@stm32mp15-disco:~# chmod 755 /usr/lib/qml/QtQuick/Layouts/libqquicklayoutsplugin.so
root@stm32mp15-disco:~# run_automotive
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

Aborted (core dumped)
root@stm32mp15-disco:~# export QT_QPA_PLATFORM=offscreen
root@stm32mp15-disco:~# run_automotive
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

Aborted (core dumped)
root@stm32mp15-disco:~# automotive 
QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
QQmlApplicationEngine failed to load component
qrc:/qml/automotive.qml:5:1: plugin cannot be loaded for module "QtQuick.Layouts": Cannot protect module QtQuick.Layouts 2 as it was never registered

 

PPAGE.13
ST Employee
August 23, 2024

Hello @nesnes 

 

we recently published a meta layer for Qt5 installation, this is available here:

https://github.com/STMicroelectronics/meta-st-x-linux-qt

 

And doc at :

https://wiki.st.com/stm32mpu/wiki/X-LINUX-QT_Expansion_Package

 

Hope it can help you to have a correct QtQuick.Layout package installation.

 

BR,

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.