Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Failed to load Qt platform plugin "xcb"
QtWS25 Last Chance

Failed to load Qt platform plugin "xcb"

Scheduled Pinned Locked Moved Solved General and Desktop
linuxxcbpluginsqt.conf
7 Posts 3 Posters 18.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lolopolosko
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      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)

      L 1 Reply Last reply
      3
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        L 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

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

          L Offline
          L Offline
          lolopolosko
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • hskoglundH hskoglund

            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)

            L Offline
            L Offline
            lolopolosko
            wrote on last edited by
            #5

            @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)"
            
            1 Reply Last reply
            0
            • L Offline
              L Offline
              lolopolosko
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

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

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                3

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved