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 run deployed qt app on another ubuntu machine: qt.qpa.plugin: could not load the qt platform plugin "xcb" in "" even though it was found
Forum Updated to NodeBB v4.3 + New Features

Failed to run deployed qt app on another ubuntu machine: qt.qpa.plugin: could not load the qt platform plugin "xcb" in "" even though it was found

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 417 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.
  • Y Offline
    Y Offline
    Yihua Liu
    wrote on last edited by
    #1

    I built my Qt app on my own machine, deployed it by CQtDeployer and copied the deployed files to another machine. Both machines run the Ubuntu 22.04 system. However, my app cannot run on another machine. It shows error as follows (sorry it is a closed net machine so I cannot copy the text):
    I have followed some posts and made sure libxcb-cursor0, libxcb-cursor-dev, libx11-xcb-dev, libx11-xcb1, libxcb-dri2-0, libxcb-dri3-0, libxcb-glx0, libxcb-icccm4, libxcb-image0, libxcb-image0-dev, libxcb-render0-dev, libxcb-render-util0-dev, libxcb-xinerama0, libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev, etc. are installed and can be found by dpkg or locate. I have set QT_QPA_PLATFORM=xcb and export QT_DEBUG_PLUGINS=1.
    微信图片_20250117200617-embedded.jpg
    How to solve this problem?

    1 Reply Last reply
    0
    • Y Yihua Liu

      @hskoglund Hi, the qt under /opt/Qt is version 6.8.1 manually built from source and exists in LD_LIBRARY_PATH; do you mean by remove this path from LD_LIBRARY_PATH? I found that libQt6Gui.so.6, libQt6Core.so.6, etc. also exist in DistributionKit/lib

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #8

      @Yihua-Liu Your application is trying to load a plugin from your deployment folder. This plugin is expecting a matching Qt version which, it seems you are saying is also in the deployment folder.

      When you ran ldd against the plugin the Qt libraries found for linking were the set in /opt/Qt.

      It is entirely possible that these are not the same Qt version. This would stop your plugin loading.

      To use the Qt libraries bundled with your application over any Qt library present elsewhere you should look at the wrapper script in Create Application Package.

      1 Reply Last reply
      1
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #2

        run:
        ldd path/libqxcb.so
        to check which libs are not installed
        libqxcb.so can not be loaded because some of its dependencies are missing.

        The error messages show libxcb-cursor0 is not installed.

        Y 1 Reply Last reply
        1
        • JoeCFDJ JoeCFD

          run:
          ldd path/libqxcb.so
          to check which libs are not installed
          libqxcb.so can not be loaded because some of its dependencies are missing.

          The error messages show libxcb-cursor0 is not installed.

          Y Offline
          Y Offline
          Yihua Liu
          wrote on last edited by
          #3

          @JoeCFD Hello, I checked ldd plugins/libqxcb.so but it seems that all dependent libraries are found:
          dcf2e449-5e98-44e2-9913-f7ff157576e8-微信图片_20250120103656-embedded.jpg
          3a26d052-68c4-4038-86d4-0e96c7381dc5-微信图片_20250120103700-embedded.jpg
          From the output libxcb-cursor.so.0 is linked to /lib/x86_64-linux-gnu/libxcb-cursor.so.0, which can be found in the fs.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #4

            Wild guess... Would one machine be running X11 and the other Wayland by any chance?

            1 Reply Last reply
            0
            • hskoglundH Online
              hskoglundH Online
              hskoglund
              wrote on last edited by hskoglund
              #5

              Also watch out for multiple installations of Qt on the target PC, I think I spot at least 2:
              one at ~/software/suis/new/DistributionKit
              one at /opt/Qt

              Try to remove one of them.
              Edit: if the Qt version in /opt/Qt is the default Ubuntu 22.04 Qt version 6.2.4 that could explain the error, since the version in ../DistributionKit is Qt 6.8.0.

              Y 1 Reply Last reply
              0
              • hskoglundH hskoglund

                Also watch out for multiple installations of Qt on the target PC, I think I spot at least 2:
                one at ~/software/suis/new/DistributionKit
                one at /opt/Qt

                Try to remove one of them.
                Edit: if the Qt version in /opt/Qt is the default Ubuntu 22.04 Qt version 6.2.4 that could explain the error, since the version in ../DistributionKit is Qt 6.8.0.

                Y Offline
                Y Offline
                Yihua Liu
                wrote on last edited by
                #6

                @hskoglund Hi, the qt under /opt/Qt is version 6.8.1 manually built from source and exists in LD_LIBRARY_PATH; do you mean by remove this path from LD_LIBRARY_PATH? I found that libQt6Gui.so.6, libQt6Core.so.6, etc. also exist in DistributionKit/lib

                JoeCFDJ C 2 Replies Last reply
                0
                • Y Yihua Liu

                  @hskoglund Hi, the qt under /opt/Qt is version 6.8.1 manually built from source and exists in LD_LIBRARY_PATH; do you mean by remove this path from LD_LIBRARY_PATH? I found that libQt6Gui.so.6, libQt6Core.so.6, etc. also exist in DistributionKit/lib

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #7

                  @Yihua-Liu run
                  strace your_app
                  You will be able to find out what is missing or path is not set properly.

                  Note you can send the output of strace to a file if the output is too much.

                  1 Reply Last reply
                  0
                  • Y Yihua Liu

                    @hskoglund Hi, the qt under /opt/Qt is version 6.8.1 manually built from source and exists in LD_LIBRARY_PATH; do you mean by remove this path from LD_LIBRARY_PATH? I found that libQt6Gui.so.6, libQt6Core.so.6, etc. also exist in DistributionKit/lib

                    C Offline
                    C Offline
                    ChrisW67
                    wrote on last edited by
                    #8

                    @Yihua-Liu Your application is trying to load a plugin from your deployment folder. This plugin is expecting a matching Qt version which, it seems you are saying is also in the deployment folder.

                    When you ran ldd against the plugin the Qt libraries found for linking were the set in /opt/Qt.

                    It is entirely possible that these are not the same Qt version. This would stop your plugin loading.

                    To use the Qt libraries bundled with your application over any Qt library present elsewhere you should look at the wrapper script in Create Application Package.

                    1 Reply Last reply
                    1
                    • Y Yihua Liu has marked this topic as solved on

                    • Login

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