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. Some doubts about Linux deployment
Forum Updated to NodeBB v4.3 + New Features

Some doubts about Linux deployment

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
16 Posts 5 Posters 1.2k Views 3 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.
  • JonBJ JonB

    @Mark81
    If for some reason you cannot run linuxdeployqt (I do not know why, but never tried it) then you might have a problem if your own deploy does not do what it does.

    If QMAKE_LFLAGS_RPATH exists it might be a good thing to use. See if it generates the right link line, if it does you're good and if it does not you're not! Assuming you're still using qmake not cmake for Qt6.

    S Offline
    S Offline
    SimonSchroeder
    wrote on last edited by
    #7

    @JonB said in Some doubts about Linux deployment:

    If for some reason you cannot run linuxdeployqt (I do not know why, but never tried it) then you might have a problem if your own deploy does not do what it does.

    This is quite annoying: You need to use the oldest still supported Linux version instead of the most current one to be able to use linuxdeployqt. The reasoning behind that is that the generated AppImage should work on all currently maintained Linux versions. If you compile on a newer Linux version your app might not run on older version. I haven't found an easy way to circumvent this restriction of linuxdeployqt.

    @Mark81 one common solution to your problem is to not run your program directly, but wrap it into a small script. The script can then first set LD_LIBRARY_PATH and after that launch your program (with all the provided command line parameters). Just name the program e.g. MyApp.bin and the script MyApp and nobody will notice that they are running a script instead of the program directly when launching MyApp.

    M Paul ColbyP 2 Replies Last reply
    1
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #8

      As a last resort, you can try installing chrpath and patch it manually like this:

      chrpath -r "$ORIGIN" MyApp
      
      M 1 Reply Last reply
      1
      • hskoglundH hskoglund

        As a last resort, you can try installing chrpath and patch it manually like this:

        chrpath -r "$ORIGIN" MyApp
        
        M Offline
        M Offline
        Mark81
        wrote on last edited by
        #9

        @hskoglund said in Some doubts about Linux deployment:

        As a last resort, you can try installing chrpath and patch it manually like this:

        chrpath -r "$ORIGIN" MyApp
        

        I get this error:

        no rpath or runpath tag found

        M 1 Reply Last reply
        0
        • S SimonSchroeder

          @JonB said in Some doubts about Linux deployment:

          If for some reason you cannot run linuxdeployqt (I do not know why, but never tried it) then you might have a problem if your own deploy does not do what it does.

          This is quite annoying: You need to use the oldest still supported Linux version instead of the most current one to be able to use linuxdeployqt. The reasoning behind that is that the generated AppImage should work on all currently maintained Linux versions. If you compile on a newer Linux version your app might not run on older version. I haven't found an easy way to circumvent this restriction of linuxdeployqt.

          @Mark81 one common solution to your problem is to not run your program directly, but wrap it into a small script. The script can then first set LD_LIBRARY_PATH and after that launch your program (with all the provided command line parameters). Just name the program e.g. MyApp.bin and the script MyApp and nobody will notice that they are running a script instead of the program directly when launching MyApp.

          M Offline
          M Offline
          Mark81
          wrote on last edited by
          #10

          @SimonSchroeder said in Some doubts about Linux deployment:

          Just name the program e.g. MyApp.bin and the script MyApp and nobody will notice that they are running a script instead of the program directly when launching MyApp.

          That's a good hint!

          1 Reply Last reply
          0
          • M Mark81

            @hskoglund said in Some doubts about Linux deployment:

            As a last resort, you can try installing chrpath and patch it manually like this:

            chrpath -r "$ORIGIN" MyApp
            

            I get this error:

            no rpath or runpath tag found

            M Offline
            M Offline
            Mark81
            wrote on last edited by Mark81
            #11

            @Mark81 said in Some doubts about Linux deployment:

            no rpath or runpath tag found

            Ok, I think this did the trick:

            patchelf --set-rpath '$ORIGIN' MyApp

            Now it looks in the current directory:

            $ ldd MyApp 
            	linux-vdso.so.1 (0x0000737d573d7000)
            	libQt6Widgets.so.6 => /home/mark/MyApp/dist/./libQt6Widgets.so.6 (0x0000737d56c00000)
            	libQt6Gui.so.6 => /home/mark/MyApp/dist/./libQt6Gui.so.6 (0x0000737d56000000)
            	libQt6SerialPort.so.6 => /home/mark/MyApp/dist/./libQt6SerialPort.so.6 (0x0000737d56bdc000)
            	libQt6Core.so.6 => /home/mark/MyApp/dist/./libQt6Core.so.6 (0x0000737d55800000)
            	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x0000737d55400000)
            	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x0000737d56b90000)
            	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000737d55000000
                    ...
            

            so far so good, but I have a last issue. When I run the executable I get:

            ./MyApp 
            ./MyApp: symbol lookup error: /home/mark/MyApp/dist/libQt6Gui.so.6: undefined symbol: _Zls6QDebugRK15QDBusObjectPath, version Qt_6
            

            but I copied the libraries from my Qt 6.8.0 installation, from /home/mark/Qt/6.8.0/gcc_64/lib/
            That Debug looks suspicious: I set the build as release and also the libraries are the release versions.

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

              And you copied libQt6DBus.so.6 as well? (maybe a stupid question :-)

              M 1 Reply Last reply
              2
              • hskoglundH hskoglund

                And you copied libQt6DBus.so.6 as well? (maybe a stupid question :-)

                M Offline
                M Offline
                Mark81
                wrote on last edited by
                #13

                @hskoglund said in Some doubts about Linux deployment:

                And you copied libQt6DBus.so.6 as well? (maybe a stupid question :-)

                It's not a stupid question! I didn't copy this library! Good catch!

                1 Reply Last reply
                0
                • S SimonSchroeder

                  @JonB said in Some doubts about Linux deployment:

                  If for some reason you cannot run linuxdeployqt (I do not know why, but never tried it) then you might have a problem if your own deploy does not do what it does.

                  This is quite annoying: You need to use the oldest still supported Linux version instead of the most current one to be able to use linuxdeployqt. The reasoning behind that is that the generated AppImage should work on all currently maintained Linux versions. If you compile on a newer Linux version your app might not run on older version. I haven't found an easy way to circumvent this restriction of linuxdeployqt.

                  @Mark81 one common solution to your problem is to not run your program directly, but wrap it into a small script. The script can then first set LD_LIBRARY_PATH and after that launch your program (with all the provided command line parameters). Just name the program e.g. MyApp.bin and the script MyApp and nobody will notice that they are running a script instead of the program directly when launching MyApp.

                  Paul ColbyP Offline
                  Paul ColbyP Offline
                  Paul Colby
                  wrote on last edited by
                  #14

                  @SimonSchroeder said in Some doubts about Linux deployment:

                  This is quite annoying: You need to use the oldest still supported Linux version instead of the most current one to be able to use linuxdeployqt. The reasoning behind that is that the generated AppImage should work on all currently maintained Linux versions. If you compile on a newer Linux version your app might not run on older version. I haven't found an easy way to circumvent this restriction of linuxdeployqt.

                  Just in case it helps, while I've never had any success with linuxdeployqt, I have had success with (and regularly use for FLOSS projects) linuxdeploy together with the linuxdeploy-plugin-qt and linuxdeploy-plugin-appimage plugins.

                  ie linuxdeployqt is not the same as (linuxdeploy + linuxdeploy-plugin-qt) - they are quite separate projects, and personally I can only recommend the latter, which might solve your linuxdeployqt issues too.

                  Cheers.

                  S 1 Reply Last reply
                  5
                  • Paul ColbyP Paul Colby

                    @SimonSchroeder said in Some doubts about Linux deployment:

                    This is quite annoying: You need to use the oldest still supported Linux version instead of the most current one to be able to use linuxdeployqt. The reasoning behind that is that the generated AppImage should work on all currently maintained Linux versions. If you compile on a newer Linux version your app might not run on older version. I haven't found an easy way to circumvent this restriction of linuxdeployqt.

                    Just in case it helps, while I've never had any success with linuxdeployqt, I have had success with (and regularly use for FLOSS projects) linuxdeploy together with the linuxdeploy-plugin-qt and linuxdeploy-plugin-appimage plugins.

                    ie linuxdeployqt is not the same as (linuxdeploy + linuxdeploy-plugin-qt) - they are quite separate projects, and personally I can only recommend the latter, which might solve your linuxdeployqt issues too.

                    Cheers.

                    S Offline
                    S Offline
                    SimonSchroeder
                    wrote on last edited by
                    #15

                    @Paul-Colby I didn't know that linuxdeploy had plugins. We are currently using linuxdeploy to create the AppDir and then linuxdeployqt to add the Qt dependencies. However, if I'm not mistaken linuxdeploy also requires an older Linux version. (But, as you can see from my example we also didn't manage to create an AppImage with linuxdeployqt alone.)

                    M 1 Reply Last reply
                    0
                    • S SimonSchroeder

                      @Paul-Colby I didn't know that linuxdeploy had plugins. We are currently using linuxdeploy to create the AppDir and then linuxdeployqt to add the Qt dependencies. However, if I'm not mistaken linuxdeploy also requires an older Linux version. (But, as you can see from my example we also didn't manage to create an AppImage with linuxdeployqt alone.)

                      M Offline
                      M Offline
                      Mark81
                      wrote on last edited by
                      #16

                      @SimonSchroeder said in Some doubts about Linux deployment:

                      @Paul-Colby I didn't know that linuxdeploy had plugins. We are currently using linuxdeploy to create the AppDir and then linuxdeployqt to add the Qt dependencies. However, if I'm not mistaken linuxdeploy also requires an older Linux version. (But, as you can see from my example we also didn't manage to create an AppImage with linuxdeployqt alone.)

                      Actually, I was able to deploy a working appimage using the three tools above! With the "low-level " approaches I still had problems.

                      I'm pretty new to these tools, but as far as I understand they can work together as plugins or just as three separate calls. I'm using Ubuntu 24.10 right now so they work on pretty modern systems (I didn't test the appimage on older systems because I don't need to support them).

                      1 Reply Last reply
                      1

                      • Login

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