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? Maybe 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...
I have found file libqxcb.so
in the Qt SDK directory, but placing it in /usr/lib
does not help.
I had this error message when trying to run "Stellarium".
With strace I found that the missing file was
libxcb-xinerama.so.0
. I had to reinstalllibxcb-xinerama0
to make it work:To any future readers who come across this - before you start (dangerously) messing around with symlinks to shared libraries, I strongly suggest that you run
export QT_DEBUG_PLUGINS=1
and then run your failing executable again in the Terminal. Read the actual error message thrown by QT, since none of the above solutions addressed the cause of this error in my case.
My output after turning on
QT_DEBUG_PLUGINS
was:so I then googled the
version `ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16))
error and found the solution to that, which solved the problem.Try to install
libqt5x11extras5
package with command:sudo apt-get install libqt5x11extras5
The name may be different. You can figure it out by searching:
sudo apt-cache search qt5 | grep 'X11 extras'
and u get the name of the package as result:
The correct solution is running the following comand onto a terminal:
sudo ln -sf /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/ /usr/bin/
It creates the symbolic link it's missed.
Running this solved it to me:
For those who are still stuck after trying every other option out there in the internet, you can look into exact path from which this notorious
libqxcb.so
is being searched in, for opening/loading by theQt
App(VirtualBox-5.2.8
is theQt
app in my case), using the strace tool. In my case, since I was buildingVirtualBox-5.2.8
from its source, it was searching forlibqxcb.so
in the below location :"...VirtualBox-5.2.8/out/linux.amd64/release/bin/platforms/"
and not in thedefault
library paths,Qt
installation path, etc. So, none of theldd
checks, and other solutions worked. And also settingQT_DEBUG_PLUGINS=1
didn't produce any extra logs either.Running strace on the the VirtualBox binary I built using Clang/LLVM on Ubuntu 17.10 x86_64:
That was my
hitting-the-nail-on-its-head
moment, and I created thesymlink
from the installedQt5.10.1
'splatforms
directory mentioned below :"...Qt5.10.1/Tools/QtCreator/lib/Qt/plugins/platforms/"
onto the searched path which is"...VirtualBox-5.2.8/out/linux.amd64/release/bin/"
. Thus,VirtualBox-5.2.8
built from source on Linux(Ubuntu 17.10 x86_64
) usingClang/LLVM
, finally launched successfully!In fact, another interesting thing here is that, I have built
VirtualBox-5.2.8
entirely usingClang/Clang++/LLVM
onUbuntu 17.10 x86_64
after substantial effort - forFreeBSD
, there's already a port for buildingVirtualBox
usingclang
but for Linux, it's heavily dependent onGCC
as I saw and hence it took a lot of effort to get to this point to be able successfully buildVirtualBox-5.2.8
from its source usingClang/Clang++/LLVM
onUbuntu 17.10 x86_64
for targetLinux/AMD64
(Ubuntu 17.10 x86_64
) and successfully launch it after resolving other issues along with this notoriouslibqxcb.so
one.Cheers.
Run ldd on your application executable to see how it resolves library dependencies.
Also this is a must read to understand what essential libraries are needed in simple case of gui application:
http://qt-project.org/doc/qt-5/linux-deployment.html
In my ubuntu type:
Can work
This is how solve few issues when I am running emulator on Ubuntu 18.04.
Add the following lines at the end of file. I install my Android SDK at
/opt/Android/Sdk
Platform: Kubuntu 18.
In my case, I did
strace -f -s 1000 zoom -o zoom.trace
, then studied zoom.trace. There was a lot of output. I searched for SIGABRT to narrow things down. The problem was that when Zoom launched /usr/bin/kde-open5, that process was hitting an internal assert right after trying to stat/usr/bin/platforms
. On a whim, I did this:and that got Zoom working. I realize that there are other issues with the KDE/QT installation that perhaps need to be fixed, but this was good enough for me to solve the problem for now.