Failed to load Qt platform plugin "xcb"



  • Hello,

    My app failed to start because didn't to find platform plugin.
    First, what I do:

    1. I put qt.conf to app folder with next content and folder structs
    [lolopolosko@localhost Project]$ cat /opt/appname/bin/qt.conf 
    [Paths]
    Prefix=../libs/Qt
    Libraries=lib
    Plugins=plugins
    
    [lolopolosko@localhost Project]$ ls -l /opt/appname/libs/*
    /opt/appname/libs/Qt:
    drwxr-xr-x.  2 root root 4096 Sep 18 20:05 lib
    drwxr-xr-x. 10 root root 4096 Sep 18 20:04 plugins
    

    but after start application I've got next message:

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    
    1. After that I try load qt.conf from resources (Read more) because
      QLibraryInfo will load qt.conf from :/qt/etc/qt.conf using the resource system

    And after that I have the same message (Failed to start ***)

    1. Next, I used -platformpluginpath (/opt/appname/libs/Qt/plugins/platforms) argument and my app works correctly, but I won't use it because it's not correctly put arguments to my app for correct work (don't ask me why)

    Can you help me with it? Why my app do not loading with qt.conf and platforms plugin?



  • Hi, loading the platforms plugin file libqxcb.so should work by using a qt.conf (otherwise Qt Creator wouldn't start, it uses a qt.conf as well). You could try tracing by export QT_DEBUG_PLUGINS=1 and see where it fails.

    Otherwise you could workaround the problem by
    export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/appname/libs/Qt/plugins/platforms
    (should be equivalent to starting your app with -platformpluginpath /opt/appname/libs/Qt/plugins/platforms)


  • Lifetime Qt Champion

    Hi,

    To add to @hskoglund, you should also check that you have all dependencies of the plugin available. You can use ldd for that.



  • @SGaist Of course, I used it. I can't see any problems



  • @hskoglund said in Failed to load Qt platform plugin "xcb":

    export QT_DEBUG_PLUGINS=1

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "".
    
    Available platform plugins are: linuxfb, minimal, offscreen, xcb.
    
    Reinstalling the application may fix this problem.
    QFactoryLoader::QFactoryLoader() checking directory path "/opt/appname/libs/Qt/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/opt/appname/libs/Qt/plugins/platforms/libqlinuxfb.so"
    (plugin/qlibrary.cpp:308:bool findPatternUnloaded(const QString&, QLibraryPrivate*)) Found metadata in lib /opt/appname/libs/Qt/plugins/platforms/libqlinuxfb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "linuxfb"
            ]
        },
        "className": "QLinuxFbIntegrationPlugin",
        "debug": true,
        "version": 329217
    }
    
    
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/opt/appname/libs/Qt/plugins/platforms/libqminimal.so"
    (plugin/qlibrary.cpp:308:bool findPatternUnloaded(const QString&, QLibraryPrivate*)) Found metadata in lib /opt/appname/libs/Qt/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "className": "QMinimalIntegrationPlugin",
        "debug": true,
        "version": 329217
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/opt/appname/libs/Qt/plugins/platforms/libqoffscreen.so"
    (plugin/qlibrary.cpp:308:bool findPatternUnloaded(const QString&, QLibraryPrivate*)) Found metadata in lib /opt/appname/libs/Qt/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "className": "QOffscreenIntegrationPlugin",
        "debug": true,
        "version": 329217
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/opt/appname/libs/Qt/plugins/platforms/libqxcb.so"
    (plugin/qlibrary.cpp:308:bool findPatternUnloaded(const QString&, QLibraryPrivate*)) Found metadata in lib /opt/appname/libs/Qt/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "className": "QXcbIntegrationPlugin",
        "debug": true,
        "version": 329217
    }
    
    
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/opt/appname/bin/platforms" ...
    loaded library "/opt/appname/libs/Qt/plugins/platforms/libqxcb.so"
    (plugin/qlibrary.cpp:585:bool QLibraryPrivate::loadPlugin()) QLibraryPrivate::loadPlugin failed on "/opt/appname/libs/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /opt/appname/libs/Qt/plugins/platforms/libqxcb.so: (libQt5XcbQpa.so.5: cannot open shared object file: No such file or directory)"
    


  • Ok.. I found problem..
    libQt5XcbQpa.so.5.6.1 is missing.
    But ldd doest show it


  • Lifetime Qt Champion

    Because it's a dependency of the plugin not of the application.


Log in to reply
 

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