I wrote application for linux which uses Qt5.
But when I am trying to launch it on the linux without Qt SDK installed, the output in console is:
Failed to load platform plugin "xcb". Available platforms are:
How can I fix this? May be I need to copy some plugin file? When I use ubuntu with Qt5 installed, but I rename Qt directory, the same problem occurs. So, it uses some file from Qt directory...
UPDATE: when I create in the app dir "platforms" folder with the file libqxcb.so, the app still doesnot start, but the error message changes:
Failed to load platform plugin "xcb". Available platforms are:
xcb
How can this happen? How can platform plugin be available but can't be loaded?
Probably this will help. I'm using Ubuntu 18.04 and when I installed Krita using the ppa method. I got this error:
I tried all the solutions that I found in this thread and other webs without success.
Finally, I found a post where the author mention that is possible to activate the debugging told of qt5 using this simple command:
After adding this command I run again krita I got the same error how ever now I know the cause.
This error prevents to the "xcb" to load properly. So the solution will be install the `libxcb-xinerama.so.0" right? However, when I run the command:
I the lib was installed. So I used an old trick yeah
--reinstall
This last command solved my problem.
I like the solution with
qt.conf
.Put
qt.conf
near to the executable with next lines:And it works like a charm :^)
Since version 5, Qt uses a platform abstraction system (QPA) to abstract from the underlying platform.
The implementation for each platform is provided by plugins. For X11 it is the XCB plugin. See Qt for X11 requirements for more information about the dependencies.
I faced the same problem when after installing Viber. It had all required qt libraries in
/opt/viber/plugins/
. I checked dependencies of/opt/viber/plugins/platforms/libqxcb.so
and found missing dependencies. They werelibxcb-render.so.0
,libxcb-image.so.0
,libxcb-icccm.so.4
,libxcb-xkb.so.1
So I resolved my issue by installing missing packages with this libraries:apt-get install libxcb-xkb1 libxcb-icccm4 libxcb-image0 libxcb-render-util0
I had this problem, and on a hunch I removed the Qt Configs from my environment. I.e.,
Then I started qtcreator and it reconfigured itself with the existing state of the machine. It no longer remembered where my projects were, but that just meant I had to browse to them "for the first time" again.
But more importantly it built itself a coherent set of library paths, so I could rebuild and run my project executables again without the xcb or qxcb libraries going missing.
In my case, I needed to deploy two Qt apps on an Ubuntu virtualbox guest. One was command-line ("app"), the other GUI_based ("app_GUI").
I used "ldd app" to find out what the required libs are, and copied them to the Ubuntu guest. While the command-line executable "app" worked ok, the GUI-based executable crashed, giving the "Failed to load platform plugin "xcb" error. I checked ldd for libxcb.so, but this too had no missing dependencies.
The problem seemed to be that while I did copy all the right libraries I accidentally had copied also libraries that were already present at the guest system.. meaning that (a) they were unnecessary to copy them in the first place and (b) worse, copying them produced incompatibilities between the install libraries. Worse still, they were undetectable by ldd like I said..
The solution? Make sure that you copy libraries shown as missing by ldd and absolutely no extra libraries.