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. qt.qpa.xcb: could not connect to display error
QtWS25 Last Chance

qt.qpa.xcb: could not connect to display error

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 5 Posters 21.3k 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.
  • D Offline
    D Offline
    deleted286
    wrote on 2 Apr 2021, 10:53 last edited by
    #1

    When i trying to run my project it gives me these errors

    qt.qpa.xcb: could not connect to display 
    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.
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 2 Apr 2021, 19:23 last edited by
      #2

      Hi
      You mean run your project stand alone ?

      Did you make a deployment folder for it ?

      D 1 Reply Last reply 6 Apr 2021, 14:16
      0
      • C Offline
        C Offline
        Colins2
        wrote on 3 Apr 2021, 13:21 last edited by
        #3

        Did you actually get QtCreator running?
        I've just upgraded to 6.03 and the latest QtCreator andf now it won't even start up.
        I get the same error message as you posted when I try to start it from Terminal.

        I have uninstalled / reinstalled but it doesn't help.
        This is on Debian, I haven't tried the upgrading the Windows installation yet.

        J 1 Reply Last reply 3 Apr 2021, 13:41
        0
        • C Colins2
          3 Apr 2021, 13:21

          Did you actually get QtCreator running?
          I've just upgraded to 6.03 and the latest QtCreator andf now it won't even start up.
          I get the same error message as you posted when I try to start it from Terminal.

          I have uninstalled / reinstalled but it doesn't help.
          This is on Debian, I haven't tried the upgrading the Windows installation yet.

          J Offline
          J Offline
          JonB
          wrote on 3 Apr 2021, 13:41 last edited by
          #4

          @Colins2
          From a terminal export QT_DEBUG_PLUGINS=1. Then type the full path to the Creator executable.

          C D 2 Replies Last reply 3 Apr 2021, 14:54
          0
          • J JonB
            3 Apr 2021, 13:41

            @Colins2
            From a terminal export QT_DEBUG_PLUGINS=1. Then type the full path to the Creator executable.

            C Offline
            C Offline
            Colins2
            wrote on 3 Apr 2021, 14:54 last edited by
            #5

            @JonB Thanks.
            I tried that command and it worked partially.
            It found all the other plugins and it also found libqxcb.so, in the same folder, but couldn't load it.
            The spurious error message was:

            QFactoryLoader::QFactoryLoader() looking at "/home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so"
            Found metadata in lib /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so, metadata=
            {
            "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
            "MetaData": {
            "Keys": [
            "xcb"
            ]
            },
            "archreq": 0,
            "className": "QXcbIntegrationPlugin",
            "debug": false,
            "version": 331520
            }

            Got keys from plugin meta data ("xcb")
            QFactoryLoader::QFactoryLoader() checking directory path "/home/colins2/Qt/Tools/QtCreator/bin/platforms" ...
            Cannot load library /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)
            QLibraryPrivate::loadPlugin failed on "/home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)"
            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.

            Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

            Aborted

            I say spurious because it found the file and read it and then said it didn't exist, followed by "couldn't load.....even though it was found"
            Very puzzling

            J 1 Reply Last reply 3 Apr 2021, 16:06
            0
            • C Colins2
              3 Apr 2021, 14:54

              @JonB Thanks.
              I tried that command and it worked partially.
              It found all the other plugins and it also found libqxcb.so, in the same folder, but couldn't load it.
              The spurious error message was:

              QFactoryLoader::QFactoryLoader() looking at "/home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so"
              Found metadata in lib /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so, metadata=
              {
              "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
              "MetaData": {
              "Keys": [
              "xcb"
              ]
              },
              "archreq": 0,
              "className": "QXcbIntegrationPlugin",
              "debug": false,
              "version": 331520
              }

              Got keys from plugin meta data ("xcb")
              QFactoryLoader::QFactoryLoader() checking directory path "/home/colins2/Qt/Tools/QtCreator/bin/platforms" ...
              Cannot load library /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)
              QLibraryPrivate::loadPlugin failed on "/home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-util.so.1: cannot open shared object file: No such file or directory)"
              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.

              Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

              Aborted

              I say spurious because it found the file and read it and then said it didn't exist, followed by "couldn't load.....even though it was found"
              Very puzzling

              J Offline
              J Offline
              JonB
              wrote on 3 Apr 2021, 16:06 last edited by
              #6

              @Colins2
              Run ldd /home/colins2/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so. I think it's telling you it can't find a libxcb-util.so.1 required dependency, or another dependency of that.

              1 Reply Last reply
              2
              • C Offline
                C Offline
                Colins2
                wrote on 3 Apr 2021, 16:24 last edited by
                #7

                @JonB
                Yes, that was it. ldd showed that I had libxcb-util.so.0 so I created a link in the same directory for libxcb-util.so.1 and now QtCreator is running.
                Many thanks for your help

                D 1 Reply Last reply 5 Apr 2021, 05:54
                0
                • J JonB
                  3 Apr 2021, 13:41

                  @Colins2
                  From a terminal export QT_DEBUG_PLUGINS=1. Then type the full path to the Creator executable.

                  D Offline
                  D Offline
                  deleted286
                  wrote on 5 Apr 2021, 05:48 last edited by
                  #8

                  @JonB said in qt.qpa.xcb: could not connect to display error:

                  @Colins2
                  From a terminal export QT_DEBUG_PLUGINS=1. Then type the full path to the Creator executable.

                  I did this step but im getting this error still

                  1 Reply Last reply
                  0
                  • C Colins2
                    3 Apr 2021, 16:24

                    @JonB
                    Yes, that was it. ldd showed that I had libxcb-util.so.0 so I created a link in the same directory for libxcb-util.so.1 and now QtCreator is running.
                    Many thanks for your help

                    D Offline
                    D Offline
                    deleted286
                    wrote on 5 Apr 2021, 05:54 last edited by
                    #9

                    @Colins2 how you created a link for it, libqxcb.so not found in my project

                    D C 2 Replies Last reply 5 Apr 2021, 05:56
                    0
                    • D deleted286
                      5 Apr 2021, 05:54

                      @Colins2 how you created a link for it, libqxcb.so not found in my project

                      D Offline
                      D Offline
                      deleted286
                      wrote on 5 Apr 2021, 05:56 last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • D deleted286
                        5 Apr 2021, 05:54

                        @Colins2 how you created a link for it, libqxcb.so not found in my project

                        C Offline
                        C Offline
                        Colins2
                        wrote on 5 Apr 2021, 06:24 last edited by Colins2 4 May 2021, 06:31
                        #11

                        @suslucoder
                        Run the ldd command that JonB posted above and scroll through the list to try and find libxcb-util.so.?
                        You seem to have a similar problem to me in that Qt can't find the shared library.
                        ldd will show you where the libxcb file is. Qt wants version .so.1 and I had .so.0 and so it wouldn't run.
                        It's probably best to try and find the newer version from your distro repo, which I will do sometime but just to try it out I created a link called libxcb-util.so.1 linked back to ver so.0 so that Qt could find it.

                        D 1 Reply Last reply 5 Apr 2021, 06:37
                        0
                        • C Colins2
                          5 Apr 2021, 06:24

                          @suslucoder
                          Run the ldd command that JonB posted above and scroll through the list to try and find libxcb-util.so.?
                          You seem to have a similar problem to me in that Qt can't find the shared library.
                          ldd will show you where the libxcb file is. Qt wants version .so.1 and I had .so.0 and so it wouldn't run.
                          It's probably best to try and find the newer version from your distro repo, which I will do sometime but just to try it out I created a link called libxcb-util.so.1 linked back to ver so.0 so that Qt could find it.

                          D Offline
                          D Offline
                          deleted286
                          wrote on 5 Apr 2021, 06:37 last edited by
                          #12

                          @Colins2 it doesnt find it. I will figure it out

                          ldd: /home/ilknur/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: No such file or directory
                          
                          C 1 Reply Last reply 5 Apr 2021, 13:40
                          0
                          • D deleted286
                            5 Apr 2021, 06:37

                            @Colins2 it doesnt find it. I will figure it out

                            ldd: /home/ilknur/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: No such file or directory
                            
                            C Offline
                            C Offline
                            Colins2
                            wrote on 5 Apr 2021, 13:40 last edited by Colins2 4 May 2021, 14:13
                            #13

                            @suslucoder
                            libxcb-utils.so.* is not a Qt library so you may have to get it using your update tool.
                            Here's an excerpt from my system from the ldd command:
                            libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007f11afec6000)
                            libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007f11afcc1000)
                            libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f11afcba000)
                            libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007f11afab3000)
                            libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007f11af8b0000)
                            Obviously showing after the link I created.

                            1 Reply Last reply
                            1
                            • M mrjj
                              2 Apr 2021, 19:23

                              Hi
                              You mean run your project stand alone ?

                              Did you make a deployment folder for it ?

                              D Offline
                              D Offline
                              deleted286
                              wrote on 6 Apr 2021, 14:16 last edited by
                              #14

                              @mrjj sorry i didnt see this answer. Im trying to run on qt creator. ı didnt deploy my project.

                              M 1 Reply Last reply 7 Apr 2021, 05:02
                              0
                              • D deleted286
                                6 Apr 2021, 14:16

                                @mrjj sorry i didnt see this answer. Im trying to run on qt creator. ı didnt deploy my project.

                                M Offline
                                M Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 7 Apr 2021, 05:02 last edited by
                                #15

                                @suslucoder

                                Ok. Is this by any chance ubuntu 20.04 ?

                                sometimes people have to install libxcb-xinerama.so

                                sometimes more.

                                sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
                                sudo apt-get install libxkbcommon-x11-dev

                                https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/64

                                but please check with ldd first, what is actually missing.

                                D 1 Reply Last reply 7 Apr 2021, 11:18
                                1
                                • M mrjj
                                  7 Apr 2021, 05:02

                                  @suslucoder

                                  Ok. Is this by any chance ubuntu 20.04 ?

                                  sometimes people have to install libxcb-xinerama.so

                                  sometimes more.

                                  sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
                                  sudo apt-get install libxkbcommon-x11-dev

                                  https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/64

                                  but please check with ldd first, what is actually missing.

                                  D Offline
                                  D Offline
                                  deleted286
                                  wrote on 7 Apr 2021, 11:18 last edited by
                                  #16

                                  @mrjj I've solve this problem with setting ld library path in environment variables.
                                  But now, it says it cannot find another lib, i really stuck on it

                                  jsulmJ 1 Reply Last reply 7 Apr 2021, 11:25
                                  0
                                  • D deleted286
                                    7 Apr 2021, 11:18

                                    @mrjj I've solve this problem with setting ld library path in environment variables.
                                    But now, it says it cannot find another lib, i really stuck on it

                                    jsulmJ Offline
                                    jsulmJ Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on 7 Apr 2021, 11:25 last edited by jsulm 4 Jul 2021, 11:27
                                    #17

                                    @suslucoder said in qt.qpa.xcb: could not connect to display error:

                                    i really stuck on it

                                    You forgot to say which other lib is not found now...
                                    Also, setting LD_LIBRARY_PATH is not necessary if all needed packages are installed properly.

                                    Please take a look at https://doc.qt.io/qt-5/linux-requirements.html

                                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    D 1 Reply Last reply 7 Apr 2021, 11:29
                                    0
                                    • jsulmJ jsulm
                                      7 Apr 2021, 11:25

                                      @suslucoder said in qt.qpa.xcb: could not connect to display error:

                                      i really stuck on it

                                      You forgot to say which other lib is not found now...
                                      Also, setting LD_LIBRARY_PATH is not necessary if all needed packages are installed properly.

                                      Please take a look at https://doc.qt.io/qt-5/linux-requirements.html

                                      D Offline
                                      D Offline
                                      deleted286
                                      wrote on 7 Apr 2021, 11:29 last edited by
                                      #18

                                      @jsulm when i run it on terminal
                                      like

                                      ./my app name
                                      

                                      there is no library that gives not found error

                                      but when i tried to run it on qt creator it is give an error.
                                      Other lib is that cannot found, libqmapcontrol.so.0
                                      it is related with qmapcontrol

                                      jsulmJ 1 Reply Last reply 7 Apr 2021, 11:31
                                      0
                                      • D deleted286
                                        7 Apr 2021, 11:29

                                        @jsulm when i run it on terminal
                                        like

                                        ./my app name
                                        

                                        there is no library that gives not found error

                                        but when i tried to run it on qt creator it is give an error.
                                        Other lib is that cannot found, libqmapcontrol.so.0
                                        it is related with qmapcontrol

                                        jsulmJ Offline
                                        jsulmJ Offline
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on 7 Apr 2021, 11:31 last edited by
                                        #19

                                        @suslucoder said in qt.qpa.xcb: could not connect to display error:

                                        qmapcontrol

                                        How did you install it (and where)?

                                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        D 1 Reply Last reply 7 Apr 2021, 11:38
                                        0
                                        • jsulmJ jsulm
                                          7 Apr 2021, 11:31

                                          @suslucoder said in qt.qpa.xcb: could not connect to display error:

                                          qmapcontrol

                                          How did you install it (and where)?

                                          D Offline
                                          D Offline
                                          deleted286
                                          wrote on 7 Apr 2021, 11:38 last edited by
                                          #20

                                          @jsulm i have a folder named as library in my project folder.
                                          And i give a path for it my my .pro file.
                                          I dont know how it is installed, i take the project from who worked here before me.
                                          But it works perfect, till the day i tried to deploy.
                                          But i deployed it to another folder, i didnt touch the orijinal project

                                          jsulmJ 1 Reply Last reply 7 Apr 2021, 12:52
                                          0

                                          1/22

                                          2 Apr 2021, 10:53

                                          • Login

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