Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Qt5.2.1 Platform issue on deployment, could not find xcb plugin. Linux
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt5.2.1 Platform issue on deployment, could not find xcb plugin. Linux

Scheduled Pinned Locked Moved Installation and Deployment
13 Posts 5 Posters 25.9k Views 1 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.
  • JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by
    #2

    Hi,

    As a general rule, you should use the Qt 5 documentation, not the Qt 4 one. In this case though, the Linux deployment page hasn't changed in a long time.

    Did you copy the script in http://qt-project.org/doc/qt-5/linux-deployment.html that sets LD_LIBRARY_PATH? (this variable tells your system where to find the libraries for your app)

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Ajp1989
      wrote on last edited by
      #3

      Yes, I did follow the Qt 5 documentation, I just linked the wrong one here.

      I have copied the script and renamed it. I know LD_LIBRARY_PATH is set correctly as program doesn't complain about missing libraries when run from script (gives xcb error). Running direclty gives an error about a missing lib.

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #4

        [quote]
        @
        This application failed to start because it could not find or load the Qt platform plugin "xcb".

        Available platform plugins are: xcb.

        Reinstalling the application may fix this problem.
        @
        [/quote]I've encountered this unintuitive message before. In my case, Ubuntu found libqxcb.so but failed to load it because one of its dependencies was missing.

        Follow the quick-and-dirty method in this guide to identify the missing dependenc(ies): http://qt-project.org/wiki/Deploy_an_Application_on_Windows It's written for Windows but also works on Linux. Just replace *.dll with *.so

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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

          Hi,

          To add to JKSH, you can run ldd on your xcb plugin to see what libraries are linked and you'll also see if something is missing

          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
          0
          • A Offline
            A Offline
            Ajp1989
            wrote on last edited by
            #6

            Thanks for your responses. Think I am having some progress, or am doing it totally wrong.

            -So I orignally was using libqxcb.so from ~/Qt/5.2.1/gcc_64/plugins/platforms with no success. I thought perhaps this might be the incorrect library so I ran ldd on the source machine a picked out a version from where it was picking it's libs, /usr/lib/x86_64, this had more dependancies so I included them in the application directory.-
            -Now I get a different error-
            @
            ~Desktop/graph-deploy/./mg_linux: symbol lookup error: ~Desktop/graph-deploy/./mg_linux: undefined symbol: _ZN19QAbstractScrollArea19setSizeAdjustPolicyENS_16SizeAdjustPolicyE
            @
            -running cfilt identfies this as-
            @
            QAbstractScrollArea::setSizeAdjustPolicy(QAbstractScrollArea::SizeAdjustPolicy)
            @
            -Any ideas? Or have I gone the wrong way?-

            -Also I compiled the original on Mint 15 and am trying to get it to run on Ubuntu 12.04. Will this be an issue?-

            -I did notice that running-
            @ldd -d -r@

            -on the original libqxcb I was using returned no missing libraries but many undefined symbol references.-

            EDIT: ignore this rubbish!

            Needed to solve the symbol errors for the file libqxcb.so from /Qt/5.2.1/gcc_64/plugins/platforms

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Ajp1989
              wrote on last edited by
              #7

              Thanks JKSH for putting me on the way to the solution!
              [quote author="JKSH" date="1393037410"]
              Follow the quick-and-dirty method in this guide to identify the missing dependenc(ies): http://qt-project.org/wiki/Deploy_an_Application_on_Windows It's written for Windows but also works on Linux. Just replace *.dll with *.so[/quote]

              Here is a Linux version of the above for those who may have a similar problem.

              Firstly copy the required platform plugin libqxcb.so to a test directory ~/test_libs from /pathToQt/plugins/platforms in my case the pathToQt was ~/Qt/5.2.1/gcc_64/

              Then copy all of the libraries from /pathToQt/lib to ~/test_libs

              Set the LD_LIBRARY_PATH
              @
              LD_LIBRARY_PATH=~/test_libs
              export LD_LIBRARY_PATH
              @

              Then run
              @
              cd ~/test_libs
              ldd -r -d libqxcb.so
              @

              This should have no errors or undefined symbol messages.

              Then you can delete libraries from ~/test_libs whilst rerunning ldd to work out the required libs, or delete all the libraries that ldd does not list from the directory ~/test_libs.

              In my case libqxcb.so required the following libraries
              libicudata.so.51
              libicui18n.so.51
              libicuuc.so.51
              libQt5Core.so.5
              libQt5DBus.so.5
              libQt5Gui.so.5

              So I think my problem was that some incompatible libraries were found on the system so ldd didn't complain about them being missing.

              1 Reply Last reply
              0
              • JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #8

                I'm glad that you've found a solution! Thank you for sharing your technique too.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  nike.niec
                  wrote on last edited by
                  #9

                  Hi
                  I am using CentOS 6.5 x86_64

                  I created a GUI Application executable named "Graphitev1" using Qt5.2.1
                  It is a Widget based application.

                  Below are dependency for my executable:
                  @
                  ldd Graphitev1
                  linux-vdso.so.1 => (0x00007fff2d5ff000)

                      libQt5PrintSupport.so.5 => /home/vedams/Qt5.2.1/5.2.1/gcc_64/lib/libQt5PrintSupport.so.5 (0x00007f4dc6bef000)
                  
                      libQt5Widgets.so.5 => /home/vedams/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Widgets.so.5 (0x00007f4dc63a8000)
                  
                      libQt5Gui.so.5 => /home/vedams/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Gui.so.5 (0x00007f4dc5d22000)
                  
                      libQt5Core.so.5 => /home/vedams/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5 (0x00007f4dc5654000)
                  
                      libGL.so.1 => /usr/lib64/libGL.so.1 (0x0000003195800000)
                  
                      libpthread.so.0 => /lib64/libpthread.so.0 (0x000000318a800000)
                  
                      libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003196400000)
                  
                      libm.so.6 => /lib64/libm.so.6 (0x000000318b400000)
                  
                      libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003195000000)
                  
                      libc.so.6 => /lib64/libc.so.6 (0x000000318a000000)
                  
                      libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x000000318c800000)
                  
                      libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x000000318b800000)
                  
                      libX11.so.6 => /usr/lib64/libX11.so.6 (0x000000318e000000)
                  
                      libicui18n.so.51 => /home/vedams/Qt5.2.1/5.2.1/gcc_64/lib/libicui18n.so.51 (0x00007f4dc5226000)
                  
                      libicuuc.so.51 => /home/vedams/Qt5.2.1/5.2.1/gcc_64/lib/libicuuc.so.51 (0x00007f4dc4ea0000)
                  
                      libdl.so.2 => /lib64/libdl.so.2 (0x000000318a400000)
                  
                      libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x000000318cc00000)
                  
                      librt.so.1 => /lib64/librt.so.1 (0x000000318ac00000)
                      /lib64/ld-linux-x86-64.so.2 (0x0000003189c00000)
                  
                      libglapi.so.0 => /usr/lib64/libglapi.so.0 (0x0000003197000000)
                  
                      libXext.so.6 => /usr/lib64/libXext.so.6 (0x000000318e800000)
                  
                      libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x0000003191400000)
                  
                      libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x0000003192000000)
                  
                      libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x000000318f000000)
                  
                      libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0 (0x0000003196c00000)
                  
                      libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0 (0x0000003195c00000)
                  
                      libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x000000318dc00000)
                  
                      libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x0000003196000000)
                  
                      libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x0000003196800000)
                  
                      libselinux.so.1 => /lib64/libselinux.so.1 (0x000000318bc00000)
                  
                      libicudata.so.51 => /home/vedams/Qt5.2.1/5.2.1/gcc_64
                  

                  /lib/libicudata.so.51 (0x00007f4dc3752000)

                      libXau.so.6 => /usr/lib64/libXau.so.6 (0x000000318d800000)
                  

                  @

                  Now i am copying this executable "Graphitev1" with dependency in another CentOS 6.5 x86_64 machine and below is contents:

                  @

                  ls -lh
                  -rwxrwxr-x. 1 vedams vedams 4.7M May 19 18:11 Graphitev1
                  lrwxrwxrwx. 1 vedams vedams 18 May 19 18:19 libicudata.so.51 -> libicudata.so.51.1
                  -rwxr-xr-x. 1 vedams vedams 22M May 19 18:11 libicudata.so.51.1
                  lrwxrwxrwx. 1 vedams vedams 18 May 19 18:19 libicui18n.so.51 -> libicui18n.so.51.1
                  -rwxr-xr-x. 1 vedams vedams 2.6M May 19 18:11 libicui18n.so.51.1
                  lrwxrwxrwx. 1 vedams vedams 16 May 19 18:18 libicuuc.so.51 -> libicuuc.so.51.1
                  -rwxr-xr-x. 1 vedams vedams 1.8M May 19 18:11 libicuuc.so.51.1
                  lrwxrwxrwx. 1 vedams vedams 19 May 19 18:18 libQt5Core.so.5 -> libQt5Core.so.5.2.1
                  -rwxr-xr-x. 1 vedams vedams 4.8M May 19 18:11 libQt5Core.so.5.2.1
                  lrwxrwxrwx. 1 vedams vedams 19 May 19 18:17 libQt5DBus.so.5 -> libQt5DBus.so.5.2.1
                  -rwxr-xr-x. 1 vedams vedams 523K May 19 18:11 libQt5DBus.so.5.2.1
                  lrwxrwxrwx. 1 vedams vedams 18 May 19 18:17 libQt5Gui.so.5 -> libQt5Gui.so.5.2.1
                  -rwxr-xr-x. 1 vedams vedams 4.6M May 19 18:11 libQt5Gui.so.5.2.1
                  lrwxrwxrwx. 1 vedams vedams 27 May 19 18:16 libQt5PrintSupport.so.5 -> libQt5PrintSupport.so.5.2.1
                  -rwxr-xr-x. 1 vedams vedams 412K May 19 18:11 libQt5PrintSupport.so.5.2.1
                  lrwxrwxrwx. 1 vedams vedams 22 May 19 18:12 libQt5Widgets.so.5 -> libQt5Widgets.so.5.2.1
                  -rwxr-xr-x. 1 vedams vedams 6.3M May 19 18:11 libQt5Widgets.so.5.2.1
                  -rwxr-xr-x. 1 vedams vedams 1.4M May 19 18:11 libqxcb.so
                  @

                  now i exported the LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD

                  now when i ran the application, i got the error

                  @

                  This application failed to start because it could not find or load the Qt platform plugin "xcb".

                  Reinstalling the application may fix this problem.
                  Aborted (core dumped)
                  @

                  Please tell me in simple manner , how to resolve this error
                  I m getting lost in above thread and following other links

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Ajp1989
                    wrote on last edited by
                    #10

                    libqxcb.so needs to reside in a folder called platforms within the application source.

                    I found it very annoying when I had this error meassge to solve.

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      nike.niec
                      wrote on last edited by
                      #11

                      Thanks a lot Ajp1989.Its working
                      But can yu please explain the reason behind this

                      And can yu give the standard procedure to pack applcation to deliver it to client.Currently for testing purpose i hardcoded lot of things.
                      By Target Machine and development machines are CentOS-6.5 x86_64
                      And i am developing a Desktop Widget based Application

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

                        Hi, I also had problems before when deploying to Ubuntu machines. I wrote about it in 2 blog posts: "how to deploy":http://www.tripleboot.org/?p=138 (scroll down to Linux GCC...) and "why you need":http://www.tripleboot.org/?p=536 that platforms directory.

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          nike.niec
                          wrote on last edited by
                          #13

                          Thanks,surely i will look into your blog

                          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 Extensions
                          • Unsolved