Qt World Summit: Submit your Presentation

QtCreator doesn't startup after updating Qt on OpenSuse Tumbleweed.. libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found

  • Hello,
    The problem I'm having has been resolved here in the past but only a work around works for me.

    Problem: QtCreator throws error at launch on Opensuse Tumbleweed, kernel 5.10.12, KDE Plasma desktop

    QFactoryLoader::QFactoryLoader() looking at "/opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so"
    Found metadata in lib /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so, metadata=
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/opt/Qt/Tools/QtCreator/bin/platforms" ...
    Cannot load library /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (/usr/lib64/libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found (required by /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so))
    QLibraryPrivate::loadPlugin failed on "/opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (/usr/lib64/libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found (required by /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so))"
    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.

    Reason: libqxcb.so looks for the wrong libQt5XcbQpa.so.5 at the default path i.e /usr/lib64. But 'Qt_5_PRIVATE_API' is not there in this file. It's in the file at '/opt/Qt/Tools/QtCreator/lib/Qt/lib/libQt5XcbQpa.so.5'.
    I found this out by 'ldd' on the xcb library & by doing 'strings' on the target library.

    Solution: add the path to the correct Qt-bundled version of target libQt5XcbQpa.so.5 to LD_LIBRARY_PATH, in a startup script. This works for me.
    One can also export this path to QT_PLUGIN_PATH during startup, as per this solution, but it didn't work for me.

    But now when I restart the machine, the KDE Plasma does not launch window system & log me in. It's due to some conflict caused by updating LD_LIBRARY_PATH during startup. KDE works fine when I revert this update at startup.
    This was the only solution that worked in fixing the QtCreator launch issue but causes other serious issues.. So I can't use it permanently.


    1. Is there a list of environment variables that are important for QtCreator at launch? Anything other than updating LD_LIBRARY_PATH that might work? Any other way to specify library path for Qt Tools?
    2. Is there a way to setup a *.conf file for QtCreator?

    I tried looking up manuals/documentation on Qt, nothing there.. I'd be really grateful for any advice or help!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Don't you have a shell script in the same folder as the Qt Creator binary ? If so, use it to start Qt Creator, it should modify the environment so it loads the correct libraries without messing up your system.

  • Hi,
    I suppose that's good enough a work around!
    I still get to use QtCreator on KDE.. But I am still curious to know what environment variables Qt tools use.. Any suggestions on where to look?
    Thanks a lot! :-)

  • Lifetime Qt Champion

    That's not a workaround, the script is there to ensure the adequate libraries are used. For example, binaries installation of Firefox do the same.

    You can read it to see how it works.

Log in to reply