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. Error while deploying Qt5.10 App on linux
Forum Updated to NodeBB v4.3 + New Features

Error while deploying Qt5.10 App on linux

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 4 Posters 5.5k 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.
  • S Offline
    S Offline
    Script22
    wrote on 9 Aug 2018, 12:00 last edited by Script22 8 Sept 2018, 12:15
    #1

    I'm trying to deploy a simple example on linux manually.

    I copied the dependecies required by running

    ldd ./binaryFile
    

    inside the app directory

    ├── app.sh
    ├── lib
    └── testApp
    

    inside the lib directory I have

    ├──lib
      ├── plugins
      ├── qml
      └── other .so files from ldd
    

    and then I run the bash script

    #!/bin/sh
     export LD_LIBRARY_PATH=`pwd`/lib
     export QML_IMPORT_PATH=`pwd`/lib/qml
     export QML2_IMPORT_PATH=`pwd`/lib/qml
     export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/lib/plugins/platforms
     #export QT_DEBUG_PLUGINS=0
     ./testApp
    

    but I get this error

    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "/home/zed/Desktop/testDep/lib/plugins/platforms".
    
    Available platform plugins are: eglfs (from /home/zed/Desktop/testDep/lib/plugins/platforms), linuxfb (from /home/zed/Desktop/testDep/lib/plugins/platforms), minimal (from /home/zed/Desktop/testDep/lib/plugins/platforms), minimalegl (from /home/zed/Desktop/testDep/lib/plugins/platforms), offscreen (from /home/zed/Desktop/testDep/lib/plugins/platforms), vnc (from /home/zed/Desktop/testDep/lib/plugins/platforms), webgl (from /home/zed/Desktop/testDep/lib/plugins/platforms), xcb (from /home/zed/Desktop/testDep/lib/plugins/platforms).
    
    Reinstalling the application may fix this problem.
    ./app.sh: line 7:  1948 Aborted                 (core dumped) ./testApp
    

    Even though the "xcb" plugin is inside the platforms directory

    when I run it using

    export QT_DEBUG_PLUGINS=1
    

    I get this debug message

    Got keys from plugin meta data ("xcb")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/zed/Desktop/testDep" ...
    QFactoryLoader::QFactoryLoader() looking at "/home/zed/Desktop/testDep/app.sh"
    QElfParser: '/home/zed/Desktop/testDep/app.sh' is not an ELF object
    "'/home/zed/Desktop/testDep/app.sh' is not an ELF object" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "/home/zed/Desktop/testDep/testApp"
    "Failed to extract plugin meta data from '/home/zed/Desktop/testDep/testApp'" 
             not a plugin
    Cannot load library /home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so: (/usr/lib/libQt5XcbQpa.so.5: symbol _ZNK15QPlatformWindow15safeAreaMarginsEv version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)
    QLibraryPrivate::loadPlugin failed on "/home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so" : "Cannot load library /home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so: (/usr/lib/libQt5XcbQpa.so.5: symbol _ZNK15QPlatformWindow15safeAreaMarginsEv version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
    QFactoryLoader::QFactoryLoader() checking directory path "/home/zed/Desktop/testDep/lib/plugins/platforms/platforms" ...
    QFactoryLoader::QFactoryLoader() checking directory path "/home/zed/Desktop/testDep/platforms" ...
    This application failed to start because it could not find or load the Qt platform plugin "xcb"
    in "/home/zed/Desktop/testDep/lib/plugins/platforms".
    

    Is there a way to fix this ?

    PS:
    Qt Version : 5.10
    Compiled on : Kubuntu 18.4
    Tested on : Manjaro XFCE 17.1

    P 1 Reply Last reply 9 Aug 2018, 15:22
    0
    • S Script22
      9 Aug 2018, 12:00

      I'm trying to deploy a simple example on linux manually.

      I copied the dependecies required by running

      ldd ./binaryFile
      

      inside the app directory

      ├── app.sh
      ├── lib
      └── testApp
      

      inside the lib directory I have

      ├──lib
        ├── plugins
        ├── qml
        └── other .so files from ldd
      

      and then I run the bash script

      #!/bin/sh
       export LD_LIBRARY_PATH=`pwd`/lib
       export QML_IMPORT_PATH=`pwd`/lib/qml
       export QML2_IMPORT_PATH=`pwd`/lib/qml
       export QT_QPA_PLATFORM_PLUGIN_PATH=`pwd`/lib/plugins/platforms
       #export QT_DEBUG_PLUGINS=0
       ./testApp
      

      but I get this error

      This application failed to start because it could not find or load the Qt platform plugin "xcb"
      in "/home/zed/Desktop/testDep/lib/plugins/platforms".
      
      Available platform plugins are: eglfs (from /home/zed/Desktop/testDep/lib/plugins/platforms), linuxfb (from /home/zed/Desktop/testDep/lib/plugins/platforms), minimal (from /home/zed/Desktop/testDep/lib/plugins/platforms), minimalegl (from /home/zed/Desktop/testDep/lib/plugins/platforms), offscreen (from /home/zed/Desktop/testDep/lib/plugins/platforms), vnc (from /home/zed/Desktop/testDep/lib/plugins/platforms), webgl (from /home/zed/Desktop/testDep/lib/plugins/platforms), xcb (from /home/zed/Desktop/testDep/lib/plugins/platforms).
      
      Reinstalling the application may fix this problem.
      ./app.sh: line 7:  1948 Aborted                 (core dumped) ./testApp
      

      Even though the "xcb" plugin is inside the platforms directory

      when I run it using

      export QT_DEBUG_PLUGINS=1
      

      I get this debug message

      Got keys from plugin meta data ("xcb")
      QFactoryLoader::QFactoryLoader() checking directory path "/home/zed/Desktop/testDep" ...
      QFactoryLoader::QFactoryLoader() looking at "/home/zed/Desktop/testDep/app.sh"
      QElfParser: '/home/zed/Desktop/testDep/app.sh' is not an ELF object
      "'/home/zed/Desktop/testDep/app.sh' is not an ELF object" 
               not a plugin
      QFactoryLoader::QFactoryLoader() looking at "/home/zed/Desktop/testDep/testApp"
      "Failed to extract plugin meta data from '/home/zed/Desktop/testDep/testApp'" 
               not a plugin
      Cannot load library /home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so: (/usr/lib/libQt5XcbQpa.so.5: symbol _ZNK15QPlatformWindow15safeAreaMarginsEv version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)
      QLibraryPrivate::loadPlugin failed on "/home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so" : "Cannot load library /home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so: (/usr/lib/libQt5XcbQpa.so.5: symbol _ZNK15QPlatformWindow15safeAreaMarginsEv version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
      QFactoryLoader::QFactoryLoader() checking directory path "/home/zed/Desktop/testDep/lib/plugins/platforms/platforms" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/home/zed/Desktop/testDep/platforms" ...
      This application failed to start because it could not find or load the Qt platform plugin "xcb"
      in "/home/zed/Desktop/testDep/lib/plugins/platforms".
      

      Is there a way to fix this ?

      PS:
      Qt Version : 5.10
      Compiled on : Kubuntu 18.4
      Tested on : Manjaro XFCE 17.1

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 9 Aug 2018, 15:22 last edited by
      #2

      @Script22 If I understood right, you developed your Qt app on Kubuntu 18.4 with Qt 5.10 and then you're deploying such app on Manjaro XFCE 17.1

      It looks like you have a Qt libraries version mismatch. From your debug info, libqxcb.so that you deployed in target machine in turn is loading/depending on libQt5XcbQpa.so.5 which seems to be already in target machine

      /home/zed/Desktop/testDep/lib/plugins/platforms/libqxcb.so: (/usr/lib/libQt5XcbQpa.so.5: ...

      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

      1 Reply Last reply
      2
      • S Offline
        S Offline
        Script22
        wrote on 9 Aug 2018, 17:23 last edited by
        #3

        Yes, I developed on Kubuntu and deploying on manjaro.

        So how to work around that ? I guess I should not replace that file as it would probably break something that manjaro uses, if I just copy it inside the libs directory would that work ?

        P 1 Reply Last reply 9 Aug 2018, 17:41
        0
        • S Script22
          9 Aug 2018, 17:23

          Yes, I developed on Kubuntu and deploying on manjaro.

          So how to work around that ? I guess I should not replace that file as it would probably break something that manjaro uses, if I just copy it inside the libs directory would that work ?

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 9 Aug 2018, 17:41 last edited by
          #4

          @Script22 said in Error while deploying Qt5.10 App on linux:

          if I just copy it inside the libs directory would that work

          I think so, but you should add that folder explicitly to the environment variable LD_LIBRARY_PATH, something like:

          $> export LD_LIBRARY_PATH:/path/to/libs/folder:$LD_LIBRARY_PATH
          

          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

          1 Reply Last reply
          3
          • S Offline
            S Offline
            Script22
            wrote on 9 Aug 2018, 17:55 last edited by
            #5

            Thanks @Pablo-J-Rogina !!
            That fixed it, will pay more attention next time :)

            jsulmJ 1 Reply Last reply 10 Aug 2018, 04:51
            0
            • S Script22
              9 Aug 2018, 17:55

              Thanks @Pablo-J-Rogina !!
              That fixed it, will pay more attention next time :)

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 10 Aug 2018, 04:51 last edited by
              #6

              @Script22 You should take a look at http://doc.qt.io/qt-5/linux-deployment.html

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

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JinPark
                wrote on 28 Jan 2021, 04:07 last edited by
                #7

                Hello, I actually exactly same error with @Script22
                I downladed qt 5.15.2 source package.
                and I located to /usr/local.

                but in /usr/local/Qt-5.15.2/plugins/platforms, There is no libxcb.so here.
                The result for ls on that folder is below.

                jin@jin-PNVKB0A0-Samsung-DeskTop:/usr/local/Qt-5.15.2/plugins/platforms$ ls
                libqeglfs.so libqminimalegl.so libqoffscreen.so libqwayland-egl.so libqwayland-xcomposite-egl.so libqwebgl.so
                libqlinuxfb.so libqminimal.so libqvnc.so libqwayland-generic.so libqwayland-xcomposite-glx.so

                So like @Script22 , I moved libxcb.so from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms
                Also I got error like him.

                So I just decided to set Environment variable QT_QPA_PLATFORM_PLUGIN_PATH to /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms. But I got same error too.
                209d32f2-2251-49f2-86ea-960b184a4e54-image.png

                92418832-e4e0-4256-945f-2891671d1e51-image.png
                How can I handle it ?

                jsulmJ 1 Reply Last reply 28 Jan 2021, 13:48
                0
                • J JinPark
                  28 Jan 2021, 04:07

                  Hello, I actually exactly same error with @Script22
                  I downladed qt 5.15.2 source package.
                  and I located to /usr/local.

                  but in /usr/local/Qt-5.15.2/plugins/platforms, There is no libxcb.so here.
                  The result for ls on that folder is below.

                  jin@jin-PNVKB0A0-Samsung-DeskTop:/usr/local/Qt-5.15.2/plugins/platforms$ ls
                  libqeglfs.so libqminimalegl.so libqoffscreen.so libqwayland-egl.so libqwayland-xcomposite-egl.so libqwebgl.so
                  libqlinuxfb.so libqminimal.so libqvnc.so libqwayland-generic.so libqwayland-xcomposite-glx.so

                  So like @Script22 , I moved libxcb.so from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms
                  Also I got error like him.

                  So I just decided to set Environment variable QT_QPA_PLATFORM_PLUGIN_PATH to /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms. But I got same error too.
                  209d32f2-2251-49f2-86ea-960b184a4e54-image.png

                  92418832-e4e0-4256-945f-2891671d1e51-image.png
                  How can I handle it ?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 28 Jan 2021, 13:48 last edited by
                  #8

                  @JinPark How exactly did you install Qt in /usr/local?
                  "I downladed qt 5.15.2 source package." - do you mean you downloaded Qt source code and build it by yourself?

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

                  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