Some doubts about Linux deployment
-
@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 scriptMyApp
and nobody will notice that they are running a script instead of the program directly when launching MyApp. -
@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
-
@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!
-
@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/
ThatDebug
looks suspicious: I set the build as release and also the libraries are the release versions. -
@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!
-
@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 thelinuxdeploy-plugin-qt
andlinuxdeploy-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 yourlinuxdeployqt
issues too.Cheers.
-
@Paul-Colby I didn't know that
linuxdeploy
had plugins. We are currently usinglinuxdeploy
to create the AppDir and thenlinuxdeployqt
to add the Qt dependencies. However, if I'm not mistakenlinuxdeploy
also requires an older Linux version. (But, as you can see from my example we also didn't manage to create an AppImage withlinuxdeployqt
alone.) -
@SimonSchroeder said in Some doubts about Linux deployment:
@Paul-Colby I didn't know that
linuxdeploy
had plugins. We are currently usinglinuxdeploy
to create the AppDir and thenlinuxdeployqt
to add the Qt dependencies. However, if I'm not mistakenlinuxdeploy
also requires an older Linux version. (But, as you can see from my example we also didn't manage to create an AppImage withlinuxdeployqt
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).