Solved qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
-
Hello.
After last qt5 update I'm getting this message:~ $ qtcreator 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)
Here is strace log https://pastebin.com/1GfBFmUH
Linux disto is manjaro which is based on archlinux. Any idea what is going on?
Thank you and best regards.
-
I am using Qt-5.15.0, got the same problem.
More details are:
QLibraryPrivate::loadPlugin failed on "/opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt/5.15.0/gcc_64/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"Solved by installing the dependent package.
Command to install: sudo apt-get install libxcb-xinerama0 -
@JamieC I had the same problem, install libxcb-xinerama0 and I solved it, Thanks!
-
Thanks very much!
I spent several hours trying to solve this problem until I got here.
sudo apt-get install libxcb-xinerama0
Thanks! -
So, Debian 10:
- ldd -r <for example, home dir>/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so | grep libxcb-util
libxcb-util.so.1 => not found
-
Ok, continue...
sudo find /usr/lib | grep libxcb-util
...
libxcb-util.so.0.0.0
libxcb-util.so.0.0
libxcb-util.so.0
, but need
libxcb-util.so.1 -
Ok, Debian... :) Redy?
sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0.0
sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1.0
sudo ln -fs /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1
QtCreator start complete! :))))
-
@singhravi Your Qt 5.12.9 has the qmake program in ~/Qt/5.12.9/gcc_64/bin/ so that PATH export setting should point the script to the correct qmake.
-
@Lengendary This is working solution for me, thank you
sudo apt-get install libxcb-xinerama0
-
For those who could face the same issue and didn't solve by reinstalling libxcb: in my case the message was the same but it was caused by apps inside lxc unabling to open display, so, try to run another GUI app like xclock.
-
Fresh install had the same issues reported here. Did what @Srinivas-Reddy suggested and install libxcb-xinerama0 and everything started working. Thanks!
-
It Worked! :facepalm: :D
Thanks a lot @hskoglund for helping me troubleshoot this! You're great.
So the problem was a ~ from the beginning. This was too silly.
Build is sucsessful and Package is running fine now. -
Hah, so it was a ~ that sent you on a wild goose chase!
(tildes can be a PITA, I remember tripping on them when trying to ssh into Ubuntu from Windows)
Anways, glad to hear its working now :-) -
@Megan-S said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
libxcb-xinerama.so.0: cannot open shared object file: No such file or directory
So do you have libxcb-xinerama.so.0?
-
@Advig said in qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.:
-
export QT_DEBUG_PLUGINS=1
-
export PATH=$PATH:~/Qt/Tools/QtCreator/bin
-
libxcb dependency so https://unix.stackexchange.com/questions/338519/how-to-install-libxcb gave the solution.
sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
- sudo apt-get install libxkbcommon-x11-dev
solved my problem for ubuntu 20.04. Tried reinstalling almost 3 times before the solution. Hope it helps someone
-
-
For those who could face the same issue: I also got
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, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
when trying to open last release of Dooble web browser (2021.07.05) on debian 10. Checking through
export QT_DEBUG_PLUGINS=1
I found thatCannot load library /opt/dooble/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory) QLibraryPrivate::loadPlugin failed on "/opt/dooble/plugins/platforms/libqxcb.so" : "Cannot load library /opt/dooble/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)" 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, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
After many tries of reinstalling libraries as suggested, finally I found the issue: I had installed
libxcb-util0
, but I neededlibxcb-util1
, which is only in the repository of Testing version of Debian 10. Installing it solved my issue.Thanks for the suggestion of using
export QT_DEBUG_PLUGINS=1
. -
@UltraBlack_
Please search again for your error message, which isqt.qpa.xcb: could not connect to display
. There are plenty of posts about that on this forum and elsewhere. As I wrote earlier that means:Not an xcb library loading problem, rather however your X display is set up/connecting.
Since you say it runs under
sudo
, I can only imagine either your permissions or your X environment is set up to allow that but not for your non-sudo
user.As always, try to run an
xterm
. If you cannot run that you know you do not have a Qt problem. -
@twar Hi, solved by sudo apt-get install libxcb*
-
Hi, maybe your wsl2 needs an X Server to be running, or perhaps you have no vGPU driver installed. Or your Windows 10 is too old so you need to upgrade to Windows 11. More here
-
Hi,
You should run your application with the
QT_DEBUG_PLUGINS
environment variable set to 1 to see what might go wrong when the plugin is loaded. -
The same as before:
~ $ ldd /usr/lib/qt/plugins/platforms/libqxcb.so /usr/lib/qt/plugins/platforms/libqxcb.so: error while loading shared libraries: /usr/lib/libxcb-xinerama.so.0: invalid ELF header
but after that
~ $ sudo pacman -S libxcb [sudo] password for tomasz: warning: libxcb-1.13-1 is up to date -- reinstalling resolving dependencies... looking for conflicting packages... Packages (1) libxcb-1.13-1 Total Download Size: 0.99 MiB Total Installed Size: 3.96 MiB Net Upgrade Size: 0.00 MiB :: Proceed with installation? [Y/n] Y :: Retrieving packages... libxcb-1.13-1-x86_64 1017.5 KiB 242K/s 00:04 [##############################] 100% (1/1) checking keys in keyring [##############################] 100% (1/1) checking package integrity [##############################] 100% (1/1) loading package files [##############################] 100% (1/1) checking for file conflicts [##############################] 100% (1/1) checking available disk space [##############################] 100% :: Processing package changes... (1/1) reinstalling libxcb [##############################] 100% :: Running post-transaction hooks... (1/1) Arming ConditionNeedsUpdate... ~ $ pacman -Qo /usr/lib/libxcb-xinerama.so.0 /usr/lib/libxcb-xinerama.so.0 is owned by libxcb 1.13-1 ~ $ ldd /usr/lib/qt/plugins/platforms/libqxcb.so linux-vdso.so.1 (0x00007ffc93f56000) libQt5XcbQpa.so.5 => /usr/lib/libQt5XcbQpa.so.5 (0x00007f730ea63000) libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x00007f730e2d5000) libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007f730dbd4000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f730d84b000) libc.so.6 => /usr/lib/libc.so.6 (0x00007f730d48f000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f730d24c000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f730cf83000) libQt5DBus.so.5 => /usr/lib/libQt5DBus.so.5 (0x00007f730ccf3000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f730cad5000) libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x00007f730c8d3000) libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f730c594000) libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f730c383000) libSM.so.6 => /usr/lib/libSM.so.6 (0x00007f730c17b000) libICE.so.6 => /usr/lib/libICE.so.6 (0x00007f730bf5f000) libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f730bd54000) libxcb-xkb.so.1 => /usr/lib/libxcb-xkb.so.1 (0x00007f730bb37000) libxcb-render-util.so.0 => /usr/lib/libxcb-render-util.so.0 (0x00007f730b933000) libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007f730b725000) libxcb-sync.so.1 => /usr/lib/libxcb-sync.so.1 (0x00007f730b51e000) libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0x00007f730b316000) libxcb-xinerama.so.0 => /usr/lib/libxcb-xinerama.so.0 (0x00007f730b113000) libxcb-randr.so.0 => /usr/lib/libxcb-randr.so.0 (0x00007f730af03000) libxcb-image.so.0 => /usr/lib/libxcb-image.so.0 (0x00007f730acfe000) libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f730aafa000) libxcb-keysyms.so.1 => /usr/lib/libxcb-keysyms.so.1 (0x00007f730a8f7000) libxcb-icccm.so.4 => /usr/lib/libxcb-icccm.so.4 (0x00007f730a6f2000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f730a4c9000) libxcb-shape.so.0 => /usr/lib/libxcb-shape.so.0 (0x00007f730a2c5000) libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007f730a086000) libxkbcommon-x11.so.0 => /usr/lib/libxkbcommon-x11.so.0 (0x00007f7309e7f000) libm.so.6 => /usr/lib/libm.so.6 (0x00007f7309aea000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f73098d2000) libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f7309647000) libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f7309411000) libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f7309165000) libz.so.1 => /usr/lib/libz.so.1 (0x00007f7308f4e000) libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f7308cc4000) libicui18n.so.61 => /usr/lib/libicui18n.so.61 (0x00007f7308819000) libicuuc.so.61 => /usr/lib/libicuuc.so.61 (0x00007f730845f000) libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 (0x00007f73081e8000) libdouble-conversion.so.1 => /usr/lib/libdouble-conversion.so.1 (0x00007f7307fd8000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f7307dd4000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f7307abd000) /usr/lib64/ld-linux-x86-64.so.2 (0x00007f730efdd000) libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f730788b000) libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007f7307684000) libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f7307474000) libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f7307223000) libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f7307011000) libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f7306e0d000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f7306c07000) libxcb-util.so.1 => /usr/lib/libxcb-util.so.1 (0x00007f7306a01000) libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f73067d0000) libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f730651a000) libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f73062ee000) librt.so.1 => /usr/lib/librt.so.1 (0x00007f73060e6000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f7305ec0000) liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f7305ca3000) libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f7305987000) libicudata.so.61 => /usr/lib/libicudata.so.61 (0x00007f7303de2000) libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f7303b70000) libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f7303950000) ~ $ qtcreator QApplication: invalid style override passed, ignoring it.
so it seems that reinstalling libxcb fixed the issue. So thank you very much guys.
I own you really big beer :-)@SGaist
there is no such thing on manjaro or archlinux which manjaro is baseed on -
Hi, try:
ldd /usr/lib/qt/plugins/platforms/libqxcb.so