qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
-
@CuriousPan said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
@JKSH, thank you for response. I will try mentioned steps. But is it relevant for Qt6 too?
You're welcome.
Yes, I believe the XCB requirements for Qt 5 and Qt 6 are very similar (or even identical)
-
Dears,
Could you please help? I'm trying to open turtlesim on my Unbutu 20.04 that I installed on my windows10 computer from the Microsoft store and that is what I'm gettingrosrun turtlesim turtlesim_node
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" 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, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
-
@Zayn said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
Unbutu 20.04 that I installed on my windows10 computer from the Microsoft store
The Windows Subsystem for Linux does not support GUIs. So you cannot run any apps that need XCB.
You have 2 options:
- Install a full Ubuntu desktop instead, either on a physical machine or a virtual machine.
- Wait until WSLg is released to the general public: https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/
-
@Zayn
I had the same problem running p4merge on WSL2First, what you have to do is to install an xserver on windows, like VcXSrv.
Then create a shortcut for the xserver (optional)"C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto
Then in Ubuntu set the xserver display in ~/.bashrc
export DISPLAY=$(ip route | awk '{print $3; exit}'):0 export LIBGL_ALWAYS_INDIRECT=1 export XCURSOR_SIZE=16
Then install the xcb dependency (found at https://wiki.qt.io/Building_Qt_5_from_Git )
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
Maybe from the last not everything is really needed, but after that it worked for me.
-
-
@homer9 said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
@corebonts Thanks ! That's solves the issue
The workaround posted by @corebonts should no longer be needed. WSL2 now supports GUIs out-of-the-box: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
-
@corebonts thx for your solution, solved for me now
-
-
@corebonts Thanks a lot brother it worked for me.
-
Thanks corebonts the solution to install '^libxcb' worked for me my application is running smoothly in ubuntu
-