1

I am trying create a qt5 application on yocto using qtwayland. When I run my application, the 'Apllication Output' displays this error

"Failed to create display (No such file or directory) Application finished with exit code 1." .

However, the bin file actually has successfully been deployed and I can run it on my board by opening the file manually. I can't debug on my board,either. How can I figure it out, thank you.

Fabrizio
  • 7,603
  • 6
  • 44
  • 104
Bird Joey
  • 11
  • 1
  • 1
  • 2

1 Answers1

2

I assume you are trying to create a Qt client application and run it on a wayland server?

On Wayland, Failed to create display (No such file or directory) means that a Wayland client couldn't connect to the compositor/display server.

So you should verify that your compositor is running. Which one are you using?

The environment variable, XDG_RUNTIME_DIR, also needs to be set both when the compositor is started and when your client is started.

If clients start when you run them on the device, it might be that the default platform for your qt installation is eglfs, not Wayland. In order to run the applications on Wayland, start it like this:

./myapp -platform wayland

or set

export QT_QPA_PLATFORM=wayland

Note that if you are running a Qt-based compositor, then the compositor should probably still be run with the eglfs backend

bobbaluba
  • 3,584
  • 2
  • 31
  • 45
  • Hi, bobbaluba. Thanks for your help. I am a green hand for QT and Wayland so I can not understand clearly. I can rum my app on my board by ./myapp -platform wayland but can not run or debug through QtCreator. Is that means that compositor is running if i can run it on my board manually. Aboout the environment variable, should i set it on the board or the PC? – Bird Joey Apr 18 '18 at 01:29
  • If `./myapp -platform wayland` shows the app, then you have a compositor running. If you can't get it to work with qtcreator, it might be that it's running with the wrong options or perhaps `XDG_RUNTIME_DIR` is set to something else than on the device? If you do `ls $XDG_RUNTIME_DIR` you should be able to see the socket, `wayland-0`, for the compositor. – bobbaluba Apr 20 '18 at 10:20
  • 1
    `export QT_QPA_PLATFORM` worked for me – Jose Areas Jul 14 '22 at 12:48
  • I did `export QT_QPA_PLATFORM=xcb ` in order to run it on Xorg – nurettin Mar 01 '23 at 05:09