Fresh install; can't start Creator
-
Hi all -
Just installed Qt (open source) onto a new laptop. When I try to run Creator, I get the following error:
Got keys from plugin meta data ("xcb") QFactoryLoader::QFactoryLoader() checking directory path "/home/mzimmers/Qt/Tools/QtCreator/bin/platforms" ... Cannot load library /home/mzimmers/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory) QLibraryPrivate::loadPlugin failed on "/home/mzimmers/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/mzimmers/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: 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.
I've found other posts referencing this problem, but my case seems to be a little more fundamental: I don't even have the file libqxcb.so.
Did something change in the installation procedure, or with the installation packaging? I don't remember running into this problem in the past.
Thanks...
-
@mzimmers Hi, please open the terminal, navigate to the folder with
qtcreator
executable and:export QT_DEBUG_PLUGINS=1 [ENTER] ./qtcreator [ENTER]
You'll see detailed info about what's detected and, most importantly, what failed to load. My guess would be that you're missing
libxcb-xinerama
(or similar, keyword here isxinerama
.
I had exactly that problem when I deployed Ubuntu on VM today, to test one Qt piece of code - installing this package solved the problem.Of course, you'll probably get libqxcb too installed as it is needed.
-
@mzimmers said in Fresh install; can't start Creator:
my case seems to be a little more fundamental: I don't even have the file libqxcb.so.
You do. Your console output shows that the file is located at /home/mzimmers/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so
"Cannot load library /home/mzimmers/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)"
There we go. libqxcb.so couldn't be loaded because
libxcb-icccm.so.4
was missing.Solution:
sudo apt-get install libxcb-icccm4
P.S. If you need further help, please tell us your exact version of Ubuntu.
-
@JKSH right you are...I thought I'd looked in that directory, but I checked again and it is indeed there. (I'm running Ubuntu 18.04 LTS, by the way.)
So, I followed your instructions, attempted to re-run Creator, and got a similar error message for libxcb (which is really libxcb0), then for keysyms, then render-util. I'm happy enough to work through these one by one (assuming, of course, there aren't hundreds of them), but...did I miss a step during installation? I don't remember having to do this in prior Qt/Creator installations.
Thanks...
-
@mzimmers said in Fresh install; can't start Creator:
did I miss a step during installation? I don't remember having to do this in prior Qt/Creator installations.
You remembered correctly.
Newer versions of pre-built Qt depend on more external xcb-related libraries compared to older versions. There were good reasons for the change, but it also came with significant downsides. Namely, not all Linux distros have these libraries installed by default -- which means we now have to install more stuff before we can use apps based on Qt 5.15 (including Qt Creator).
See the following if you're interested in the gory details:
- https://codereview.qt-project.org/c/qt/qtbase/+/253905
- https://bugreports.qt.io/browse/QTBUG-84749?focusedCommentId=519832#comment-519832
I'm happy enough to work through these one by one (assuming, of course, there aren't hundreds of them)
If something like this happens again in the future, you can identify all the missing libraries in one go by calling
ldd
onlibqxcb.so
. That should hopefully be faster than trying to launch Qt Creator repeatedly.