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. Deploying Application on Linux
Forum Update on Monday, May 27th 2025

Deploying Application on Linux

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 5 Posters 1.6k 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.
  • U Offline
    U Offline
    unzu
    wrote on 30 Dec 2020, 17:57 last edited by unzu
    #1

    Hi,

    I am trying to deploy my application on Linux (Ubuntu 20.04.7) .
    I am following the guide on Qt for Linux/X11 - Deployment but cannot get it to run.

    1. The executable is build via QtCreator and runs on its own when I start it via the console.
    2. I have created 2 folders inside the directory, plugins and platforms. Platforms contains libqxcb.so and plugins libqsqlmysql.so.
    3. I ran ldd appname, checked all libraries containing Qt in their name and copied them in my directory (they were in the home/Qt/5.15.2/gcc_64/lib folder.
    4. I copied the startup-script which will (as far as I have understood) add my directory-path as library-path and start the application.
    5. I also checked libqxcb.so with ldd and added libxcb-xinerama and libQt5XcbQpa.so.5 because they where listed there.

    The application is build properly (I guess, I can still execute it on via the console), however I cannot execute it via the script, I get an error-message:

    symbol lookup error: /home/*****/Desktop/Qt_BTLE_Mooshi/build-Qt_BTLE_Mooshi-Desktop_Qt_5_15_2_GCC_64bit-Profile/./libQt5XcbQpa.so.5: undefined symbol: _ZN22QWindowSystemInterface24setPlatformFiltersEventsEb, version Qt_5_PRIVATE_API
    

    I guess i have misunderstood some step when adding the libraries because the application runs on its own but I cannot figure it out what I did wrong .. :(

    Any experienced users got some hints on what I did wrong/what I have to do?
    Thanks in advance
    Unzu

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 30 Dec 2020, 18:08 last edited by
      #2

      Hi
      Seems you did well.
      Sounds correct.
      And yes. step 4 add your app folder to the paths where the OS will try load So files.

      did you try ldd on libQt5XcbQpa and see if it needs something also ?

      1 Reply Last reply
      1
      • U Offline
        U Offline
        unzu
        wrote on 30 Dec 2020, 19:40 last edited by unzu
        #3

        @mrjj said in Deploying Application on Linux:

        And yes. step 4 add your app folder to the paths where the OS will try load So files.
        Could you explain that please? I thought I can put my application folder anywhere I want?

        I tried some things:

        • I am still on the computer where I build the app.
        • When I delete all library-files, the application works with the script.
        • I started adding 1 library after the other to my application folder and tried running the script. So far I added:
        1. libQt5Gui.so.5.15.2, libQt5Gui.so.5 (I added both, first is the library itself, second is the link to it.)
        2. libQt5Widgets.so.5.15.2, libQt5Widgets.so.5 (again library and link)

        Up to this point, the script still works. I think it takes the libraries that I've provided in my folder and gets the missing ones from the Qt-directory itself.

        1. libtQt5Bluetooth.so.5.15.2, libQt5Bluetooth.so.5 <- Here it starts to become strange. The script wont work anymore and I get the error-message:
        error while loading shared libraries: libQt5Concurrent.so.5: cannot open shared object file: No such file or directory
        

        What is happening here? If it was able to find all libraries before, including the QBluetooth and QConcurrent-libraries, how can it not find the QConcurrent-library anymore? I mean, its still in the Qt-directory..???

        1. Despite the strange behavior in step 3, I added libQt5Concurrent.so.5.15.2, libQt5Concurrent.so.5 and tried executing the script again. Error message:
        Cannot mix incompatible Qt library (5.12.8) with this library (5.15.2)
        

        I am really stuck and I don't know what else I could try, help is much appreciated.

        Unzu

        M 1 Reply Last reply 30 Dec 2020, 19:58
        0
        • U unzu
          30 Dec 2020, 19:40

          @mrjj said in Deploying Application on Linux:

          And yes. step 4 add your app folder to the paths where the OS will try load So files.
          Could you explain that please? I thought I can put my application folder anywhere I want?

          I tried some things:

          • I am still on the computer where I build the app.
          • When I delete all library-files, the application works with the script.
          • I started adding 1 library after the other to my application folder and tried running the script. So far I added:
          1. libQt5Gui.so.5.15.2, libQt5Gui.so.5 (I added both, first is the library itself, second is the link to it.)
          2. libQt5Widgets.so.5.15.2, libQt5Widgets.so.5 (again library and link)

          Up to this point, the script still works. I think it takes the libraries that I've provided in my folder and gets the missing ones from the Qt-directory itself.

          1. libtQt5Bluetooth.so.5.15.2, libQt5Bluetooth.so.5 <- Here it starts to become strange. The script wont work anymore and I get the error-message:
          error while loading shared libraries: libQt5Concurrent.so.5: cannot open shared object file: No such file or directory
          

          What is happening here? If it was able to find all libraries before, including the QBluetooth and QConcurrent-libraries, how can it not find the QConcurrent-library anymore? I mean, its still in the Qt-directory..???

          1. Despite the strange behavior in step 3, I added libQt5Concurrent.so.5.15.2, libQt5Concurrent.so.5 and tried executing the script again. Error message:
          Cannot mix incompatible Qt library (5.12.8) with this library (5.15.2)
          

          I am really stuck and I don't know what else I could try, help is much appreciated.

          Unzu

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 30 Dec 2020, 19:58 last edited by
          #4

          @unzu
          But is the error correct ?
          Did you have 5.12.8 installed at some point?

          It seems to find another version ?

          Could it be that libQt5Concurrent.so.5 is a link to other version ?

          1 Reply Last reply
          0
          • U Offline
            U Offline
            unzu
            wrote on 30 Dec 2020, 20:36 last edited by unzu
            #5

            @mrjj said in Deploying Application on Linux:

            Did you have 5.12.8 installed at some point?

            I dont think so.
            I've setup the system a few days ago and I dont think that I have installed multiple Qt Versions.
            However, I managed to 'fix' it, it is working now:

            I was that desparate, that I copied all the Qt libraries: ALL OF 'EM! and put them in my directory.
            And you know what? ...the script works!

            I don't know why and how, but I can take my folder, put it on a different computer that never saw Qt and can run my application.
            One thing that I noticed is, that there were some libraries both in the linux-/lib/-folder and in the Qt-folder.
            For example, I took libicuuc, libicuio and so on from the linux-lib-folder, because when i ran ldd on my application, it showed the libraries there. Maybe I was supposed to take those libraries from the Qt folder?

            Currently I am very happy that it's running after spending multiple days on that issue :)
            The application doesn't detect the libqmysql-plugin right now, not sure what the cause for that is, but I am positive that there is some way to get it to work.. :)

            Thanks so far for your time and help!
            Unzu

            M 1 Reply Last reply 30 Dec 2020, 20:50
            1
            • U unzu
              30 Dec 2020, 20:36

              @mrjj said in Deploying Application on Linux:

              Did you have 5.12.8 installed at some point?

              I dont think so.
              I've setup the system a few days ago and I dont think that I have installed multiple Qt Versions.
              However, I managed to 'fix' it, it is working now:

              I was that desparate, that I copied all the Qt libraries: ALL OF 'EM! and put them in my directory.
              And you know what? ...the script works!

              I don't know why and how, but I can take my folder, put it on a different computer that never saw Qt and can run my application.
              One thing that I noticed is, that there were some libraries both in the linux-/lib/-folder and in the Qt-folder.
              For example, I took libicuuc, libicuio and so on from the linux-lib-folder, because when i ran ldd on my application, it showed the libraries there. Maybe I was supposed to take those libraries from the Qt folder?

              Currently I am very happy that it's running after spending multiple days on that issue :)
              The application doesn't detect the libqmysql-plugin right now, not sure what the cause for that is, but I am positive that there is some way to get it to work.. :)

              Thanks so far for your time and help!
              Unzu

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 30 Dec 2020, 20:50 last edited by
              #6

              @unzu
              Good work.
              Well normally one don't need to take system
              So files as they are already installed by the os.

              regarding libqmysql-plugin
              did you install the mysql client libs ? the plugin will try to load them.

              Nothing very bad about copying all of them.
              You could then on the clean linux, simply rename those you think you surely are not using
              and see if it still starts.

              Btw there is also
              https://github.com/probonopd/linuxdeployqt
              Only tested it a bit but not so much as when you first made a deplyment folder you can reuse it untill you switch Qt version.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mnesarco
                wrote on 1 Jan 2021, 01:59 last edited by
                #7

                You can use linuxdeploy. It is easy peasy (note that linuxdeploy is not linuxdeployqt)

                https://github.com/linuxdeploy/linuxdeploy

                JonBJ 1 Reply Last reply 1 Jan 2021, 08:02
                0
                • M mnesarco
                  1 Jan 2021, 01:59

                  You can use linuxdeploy. It is easy peasy (note that linuxdeploy is not linuxdeployqt)

                  https://github.com/linuxdeploy/linuxdeploy

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on 1 Jan 2021, 08:02 last edited by JonB 1 Jan 2021, 08:03
                  #8

                  @mnesarco
                  Hi. I had heard about linuxdeployqt, but not linuxdeploy. You're not the author, are you? :) Would you care to summarize why linuxdeploy is better/preferred by you?

                  1 Reply Last reply
                  0
                  • U Offline
                    U Offline
                    unzu
                    wrote on 7 Jan 2021, 13:20 last edited by
                    #9

                    Thanks for all the responses.

                    I've already looked into linuxdeployqt, however it is mandatory to use the oldest LTS Ubuntu version, which was no option for me.
                    Following the deployment guide I manged to get the app to work.
                    I really like mrjj's idea to just copy the entire library-folder and to delete unneeded apps via testing on a clean linux system.

                    I also managed to get the mysql-plugin to work.
                    The error I made was to assume that I have to put the library into the plugins folder as mentioned in the Qt for Linux/X11 - Deployment Guide.
                    If I had read the guide more carefully, I would have seen that the plugins need to be put into specific folders, eg. sqldrivers for the mysql-plugin.

                    unzu

                    jsulmJ 1 Reply Last reply 7 Jan 2021, 13:23
                    0
                    • U unzu
                      7 Jan 2021, 13:20

                      Thanks for all the responses.

                      I've already looked into linuxdeployqt, however it is mandatory to use the oldest LTS Ubuntu version, which was no option for me.
                      Following the deployment guide I manged to get the app to work.
                      I really like mrjj's idea to just copy the entire library-folder and to delete unneeded apps via testing on a clean linux system.

                      I also managed to get the mysql-plugin to work.
                      The error I made was to assume that I have to put the library into the plugins folder as mentioned in the Qt for Linux/X11 - Deployment Guide.
                      If I had read the guide more carefully, I would have seen that the plugins need to be put into specific folders, eg. sqldrivers for the mysql-plugin.

                      unzu

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 7 Jan 2021, 13:23 last edited by
                      #10

                      @unzu said in Deploying Application on Linux:

                      however it is mandatory to use the oldest LTS Ubuntu version

                      It's not.This is simply an advice to have a package which can be run on as many Linux distributions as possible. You do not have to follow this advice.

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

                      M 1 Reply Last reply 7 Jan 2021, 13:43
                      0
                      • jsulmJ jsulm
                        7 Jan 2021, 13:23

                        @unzu said in Deploying Application on Linux:

                        however it is mandatory to use the oldest LTS Ubuntu version

                        It's not.This is simply an advice to have a package which can be run on as many Linux distributions as possible. You do not have to follow this advice.

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 7 Jan 2021, 13:43 last edited by mrjj 1 Jul 2021, 13:44
                        #11

                        @jsulm
                        Hi
                        So linuxdeploy +Qt plugin allows to run on newer distros (to make the appDir) ? as when tried
                        linuxdeployqt it refused to do anything due to the distro being too new.

                        Also there was talk about -unsupported-allow-new-glibc options but it did not
                        know that option.

                        so linuxdeploy is more "relaxed" ?

                        That does indeed sound promising.

                        jsulmJ 1 Reply Last reply 7 Jan 2021, 13:49
                        0
                        • M mrjj
                          7 Jan 2021, 13:43

                          @jsulm
                          Hi
                          So linuxdeploy +Qt plugin allows to run on newer distros (to make the appDir) ? as when tried
                          linuxdeployqt it refused to do anything due to the distro being too new.

                          Also there was talk about -unsupported-allow-new-glibc options but it did not
                          know that option.

                          so linuxdeploy is more "relaxed" ?

                          That does indeed sound promising.

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 7 Jan 2021, 13:49 last edited by
                          #12

                          @mrjj said in Deploying Application on Linux:

                          Also there was talk about -unsupported-allow-new-glibc options but it did not
                          know that option

                          See https://github.com/probonopd/linuxdeployqt/blob/master/tools/linuxdeployqt/main.cpp
                          It's -unsupported-bundle-everything or -unsupported-allow-new-glibc

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

                          1 Reply Last reply
                          0

                          1/12

                          30 Dec 2020, 17:57

                          • Login

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