Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Why Qt platform plugin “xcb” cannot be loaded even though it was found?
Qt 6.12 LTS is out! See what's new in the release blog

Why Qt platform plugin “xcb” cannot be loaded even though it was found?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
18 Posts 5 Posters 17.9k Views 2 Watching
  • 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.
  • R rrd0

    @SGaist

    Here's the whole output with QT_DEBUG_PLUGINS=1:

    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqeglfs.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqeglfs.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "eglfs"
            ]
        },
        "archreq": 0,
        "className": "QEglFSIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqlinuxfb.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqlinuxfb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "linuxfb"
            ]
        },
        "archreq": 0,
        "className": "QLinuxFbIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqminimal.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "archreq": 0,
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqminimalegl.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqminimalegl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "minimalegl"
            ]
        },
        "archreq": 0,
        "className": "QMinimalEglIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqoffscreen.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "archreq": 0,
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqvnc.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqvnc.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "vnc"
            ]
        },
        "archreq": 0,
        "className": "QVncIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqwebgl.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqwebgl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "webgl"
            ]
        },
        "archreq": 0,
        "className": "QWebGLIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("webgl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqxcb.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "archreq": 0,
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app-directory" ...
    QFactoryLoader::QFactoryLoader() looking at "/home/user/app-directory/app"
    "Failed to extract plugin meta data from '/home/user/app-directory/app'" 
             not a plugin
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/platforms/platforms" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqeglfs.so"
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqlinuxfb.so"
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqminimal.so"
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqminimalegl.so"
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqoffscreen.so"
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqvnc.so"
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqwebgl.so"
    Got keys from plugin meta data ("webgl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqxcb.so"
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app-directory/platforms" ...
    Could not load shared library symbols for /usr/local/qt5pi/plugins/platforms/libqxcb.so.
    Do you need "set solib-search-path" or "set sysroot"?loaded library "/usr/local/qt5pi/plugins/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display 
    qt.qpa.xcb: could not connect to display 
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/qt5pi/plugins/platforms" 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.
    
    Available platform plugins are: eglfs (from /usr/local/qt5pi/plugins/platforms), linuxfb (from /usr/local/qt5pi/plugins/platforms), minimal (from /usr/local/qt5pi/plugins/platforms), minimalegl (from /usr/local/qt5pi/plugins/platforms), offscreen (from /usr/local/qt5pi/plugins/platforms), vnc (from /usr/local/qt5pi/plugins/platforms), webgl (from /usr/local/qt5pi/plugins/platforms), xcb (from /usr/local/qt5pi/plugins/platforms), eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl, xcb.
    

    TL;DR:

    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqxcb.so"
    Found metadata in lib /usr/local/qt5pi/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "archreq": 0,
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 330752
    }
    
    
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app-directory" ...
    QFactoryLoader::QFactoryLoader() looking at "/home/user/app-directory/app"
    "Failed to extract plugin meta data from '/home/user/app-directory/app'" 
             not a plugin
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/platforms/platforms" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/platforms" ...
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqeglfs.so"
    Got keys from plugin meta data ("eglfs")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqlinuxfb.so"
    Got keys from plugin meta data ("linuxfb")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqminimal.so"
    Got keys from plugin meta data ("minimal")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqminimalegl.so"
    Got keys from plugin meta data ("minimalegl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqoffscreen.so"
    Got keys from plugin meta data ("offscreen")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqvnc.so"
    Got keys from plugin meta data ("vnc")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqwebgl.so"
    Got keys from plugin meta data ("webgl")
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/platforms/libqxcb.so"
    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/user/app-directory/platforms" ...
    Could not load shared library symbols for /usr/local/qt5pi/plugins/platforms/libqxcb.so.
    Do you need "set solib-search-path" or "set sysroot"?loaded library "/usr/local/qt5pi/plugins/platforms/libqxcb.so"
    qt.qpa.xcb: could not connect to display 
    qt.qpa.xcb: could not connect to display 
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/qt5pi/plugins/platforms" 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.
    
    Available platform plugins are: eglfs (from /usr/local/qt5pi/plugins/platforms), linuxfb (from /usr/local/qt5pi/plugins/platforms), minimal (from /usr/local/qt5pi/plugins/platforms), minimalegl (from /usr/local/qt5pi/plugins/platforms), offscreen (from /usr/local/qt5pi/plugins/platforms), vnc (from /usr/local/qt5pi/plugins/platforms), webgl (from /usr/local/qt5pi/plugins/platforms), xcb (from /usr/local/qt5pi/plugins/platforms), eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl, xcb.
    
    Pablo J. RoginaP Offline
    Pablo J. RoginaP Offline
    Pablo J. Rogina
    wrote on last edited by
    #6

    @rrd0 from your error log please see entries like this

    qt.qpa.xcb: could not connect to display

    that coupled with the way you said you're starting your app

    when I try to run the same app from a remote debug session

    seems to me that you're not using a SSH session with X Forwarding... don't forget the -X parameter along with proper hosts authorization

    ssh -X user@hostname
    

    Upvote the answer(s) that helped you solve the issue
    Use "Topic Tools" button to mark your post as Solved
    Add screenshots via postimage.org
    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

    R 1 Reply Last reply
    1
    • Pablo J. RoginaP Pablo J. Rogina

      @rrd0 from your error log please see entries like this

      qt.qpa.xcb: could not connect to display

      that coupled with the way you said you're starting your app

      when I try to run the same app from a remote debug session

      seems to me that you're not using a SSH session with X Forwarding... don't forget the -X parameter along with proper hosts authorization

      ssh -X user@hostname
      
      R Offline
      R Offline
      rrd0
      wrote on last edited by
      #7

      @Pablo-J.-Rogina

      I'm not using X forwarding. The app is displayed on the target. Just text (stdout and stderr, I guess) is displayed on my dev machine.

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

        You still have to configure things properly. You are starting your application remotely, so you have to configure your session so that your application tries to connect to the local X server.

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

        R 1 Reply Last reply
        1
        • SGaistS SGaist

          You still have to configure things properly. You are starting your application remotely, so you have to configure your session so that your application tries to connect to the local X server.

          R Offline
          R Offline
          rrd0
          wrote on last edited by rrd0
          #9

          @SGaist

          QtCreator has a tab to set Host, SHH port, username, key file, etc. But there's no box where I could enter that -X option.

          Could you give me some pointers?

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rrd0
            wrote on last edited by
            #10
            This post is deleted!
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #11

              I may be wrong but I don't think you currently can.

              Out of curiosity, what is the reason for having a full X server running on your embedded target ?

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

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

                Hi, I also run Qt apps on my Raspberry Pi, and when I had problems using the -platform xcb to connect to them, I instead use -platform vnc works fine.
                (On my PC I use vncviewer.exe to connect)

                R 1 Reply Last reply
                1
                • SGaistS SGaist

                  I may be wrong but I don't think you currently can.

                  Out of curiosity, what is the reason for having a full X server running on your embedded target ?

                  R Offline
                  R Offline
                  rrd0
                  wrote on last edited by rrd0
                  #13

                  @SGaist

                  I'm using X cause I tried (a lot) to run my apps on EGLFS with no success. I followed the RaspberryPi2EGLFS guide, from qt wiki, to build Qt for RPi, but never managed to make it work.

                  Do you know some other guide that could help me build Qt (EGLFS) for RPi?

                  P.S. Someone updated the RaspberryPi2EGLFS guide, so I'll give it a last try.

                  1 Reply Last reply
                  0
                  • hskoglundH hskoglund

                    Hi, I also run Qt apps on my Raspberry Pi, and when I had problems using the -platform xcb to connect to them, I instead use -platform vnc works fine.
                    (On my PC I use vncviewer.exe to connect)

                    R Offline
                    R Offline
                    rrd0
                    wrote on last edited by
                    #14

                    @hskoglund

                    I'll try that. Thanks!

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

                      Any chance you are having trouble using a Raspbian Stretch root filesystem ?

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

                      R 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Any chance you are having trouble using a Raspbian Stretch root filesystem ?

                        R Offline
                        R Offline
                        rrd0
                        wrote on last edited by
                        #16

                        @SGaist

                        What kind of trouble?

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

                          The EGLFS issue.

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

                          R 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            The EGLFS issue.

                            R Offline
                            R Offline
                            rrd0
                            wrote on last edited by
                            #18

                            @SGaist

                            Raspbian Stretch is the distribution used in RaspberryPi2EGLFS guide, and I followed each one of the steps described in that guide. So, I don't think there's something wrong with my root filesystem.

                            1 Reply Last reply
                            0

                            • Login

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