Qt 5.12.1 Cannot load library /opt/Qt/5.12.1/gcc_64/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)



  • I was trying to upgrade my Centos 7.5 Dockerfile from using 5.12.0 to 5.12.1.

    The only thing that I change in the Dockerfile were the version numbers (5.12.0 to 5.12.1) in the following lines:

    #install qt5.12
    ADD qt-installer-noninteractive.qs .
    RUN wget -q http://download.qt.io/archive/qt/5.12/5.12.1/qt-opensource-linux-x64-5.12.1.run
    RUN chmod +x qt-opensource-linux-x64-5.12.1.run
    RUN ./qt-opensource-linux-x64-5.12.1.run --platform minimal --script qt-installer-noninteractive.qs --verbose
    
    RUN /opt/Qt/Tools/QtCreator/bin/qbs setup-toolchains --detect 
    RUN /opt/Qt/Tools/QtCreator/bin/qbs setup-qt '/opt/Qt/5.12.1/gcc_64/bin/qmake' QtProfile
    RUN /opt/Qt/Tools/QtCreator/bin/qbs config profiles.QtProfile.baseProfile clang
    
    ENV PATH="/opt/Qt/5.12.1/gcc_64/bin:${PATH}"
    ENV LD_LIBRARY_PATH="/opt/Qt/5.12.1/gcc_64/lib:${LD_LIBRARY_PATH}"
    

    Now when I run a very basic application (just a empty QMainwindow) using a docker-compose file it crashes.

    I saw in another post here on the forum that suggested using QT_DEBUG_PLUGINS=1
    Where I got the following error message:

    application-run        | Got keys from plugin meta data ("xcb")
    application-run        | QFactoryLoader::QFactoryLoader() checking directory path "/home/polaris/bin/platforms" ...
    application-run        | Cannot load library /opt/Qt/5.12.1/gcc_64/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)
    application-run        | QLibraryPrivate::loadPlugin failed on "/opt/Qt/5.12.1/gcc_64/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt/5.12.1/gcc_64/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)"
    application-run        | qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    application-run      | This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    application-run        |
    application-run        | Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
    application-run       |
    

    I've tried all the suggestions in the post that I linked to above, and non of them fix this problem.

    Again this application runs fine on Qt 5.12.0.


  • Moderators

    @plover
    you need to install additional packages (e.g. for debian: "apt install libxkbcommon-x11-0")
    Maybe the base image has updated in the meantime?



  • @raven-worx No the base image has not been updated. I've created a new image with 5.12.0 and another with 5.12.1 . The error only comes in 5.12.1. I've tried to reinstall libqxcb and libxkbcommon but that does not fix anything.


  • Lifetime Qt Champion

    What version of Xkbcommon do you have ?
    Once installed what does ldd /opt/Qt/5.12.1/gcc_64/plugins/platforms/libqxcb.so return ?



  • @SGaist I had the same error message after updating from working 5.12.0 to 5.12.1.
    "apt install libxkbcommon-x11-0" fixed it on Debian 9. The version of the package is 0.7.1-2~deb9u1.
    But I did not do any distro updates either while updating Qt, so the need for libxkbcommon seems to come with 5.12.1 installation.


  • Moderators

    @J0hnny said in Qt 5.12.1 Cannot load library /opt/Qt/5.12.1/gcc_64/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory):

    "apt install libxkbcommon-x11-0" fixed it on Debian 9. The version of the package is 0.7.1-2~deb9u1.
    But I did not do any distro updates either while updating Qt, so the need for libxkbcommon seems to come with 5.12.1 installation.

    as i already said.
    You probably have a FROM BaseImage in your Dockerfile no? Can you guarantee that the package wasn*t updated in the meantime? Or maybe the dependency was removed from another package you installed which is missing now for you.


  • Lifetime Qt Champion

    Since 5.12.1 and because the oldest supported distribution provides xkbcommon, the bundled version has been removed. Therefore xkbcommon must be provided by your distribution.



  • @SGaist Can you please point to the related documentation about xkbcommon and Qt 5.12.1?


  • Lifetime Qt Champion

    It's in the 5.12.1 changelog



  • It is very odd that a large configuration change like this was made to an update on an LTS version of Qt. In addition, the bug this change was made against hasn't even passed testing, it is still in progress. I would expect more rigor on an LTS release.

    We started using Qt 5.12.0 on RHEL6.x, and it passed our testing at time of release. Now, with a quiet update it no longer works. With RHEL 6 not being retired until November 30, 2020, I'm not sure why the decision was made to drop support in 5.12 LTS (especially considering it worked well until now).

    I think it would be best if this change was reverted in the next 5.12 update, and pushed to 5.13.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    It's explained in the change log. However if you want to discuss about that. You should go to the development mailing list. You'll find there Qt's developers/maintainers. This is a user forum.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.