I've built an app using Qt6, on Ubuntu 22.04. How can I deploy it to other linux, e.g. Mint.
-
I've built an app based BlockingReceiver, using Qt6, on Ubuntu 22.04. How I can deploy it to other linux machine, e.g. Linux Mint. Whatever I try, always some libs are missing. which is a way to build the deploy file to put on USBdrive. I'm new to linux & Qt. Until now I built my apps on windows, using MS VStudio, C++, C#. with regards, Yuri.
-
Both Ubuntu and Mint are based on Debian, so you can create a .deb package and it should work.
Alternatively, take a look into AppImage or Flatpak for packaging which works on (nearly) all Linux distributions.
-
Both Ubuntu and Mint are based on Debian, so you can create a .deb package and it should work.
Alternatively, take a look into AppImage or Flatpak for packaging which works on (nearly) all Linux distributions.
-
Indeed, it can help :-) But by using
linuxdeployqt
he would already be foced down the AppImage path - I wanted to note that there are other options, too. -
Indeed, it can help :-) But by using
linuxdeployqt
he would already be foced down the AppImage path - I wanted to note that there are other options, too. -
Hi, thank you all. I'm new to linux. I did try to use linuxdeplyqt. It didn't work because my dev. linux is "too new". Found proposals to set VM with guest older ubuntu. I did it, installed ubuntu 18. Qt online installer said it will not work because of absent of LIBC_2.28. Then upgraded VM-guest ubuntu to 20. Now problems with Qt. And to program in Qt in VM guest OS - looks just impossible. After 4 days of full-time work I'm still nowhere. And when my easy GUI app supporting serial port works OK on dev.machine! I'm electronics engineer and all my SW knowledge is self-taught. And mainly it's SW for microcontrollers. Only to add I'm 73.. The app I try to build on linux is what I wrote in MS VStudio C#, Win, just want to move it all to linux.
If somebody will give me more pointed instruction how to build deployment, preferrably via USBdisk, I will be very thankful.
In any case I'm very impressed by the fact the people try to help me, and so fast.
with regards, Yuri. -
to continue, I copied all ~/Qt/6.5.3/gcc_64/lib/ to target Linux Mint 20. Now try to run my app' gives:
./blockingreceiver: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found (required by ./blockingreceiver)
I cannot find this file on both machines, also on my dev. Ubuntu 22.04. Where it should be?
Maybe I should better try to upgrade my target machine to mint 22 ? -
yes, the joys of deploying on Linux... I know it does not help, but the problems you describe are quite typical, deploying to Linux is always a hassle.
Some general recommendations:
- use some older VM as suggested, ubuntu 20 looks OK
- in VM, use OS-provided Qt if possible (
sudo apt install qt6-base
and so on) - compile your program in VM using either Qt Creator or from command line - but make sure you build in release mode (not debug)!
- once you have this base covered, start with
linuxdeployqt
If you run into Qt version incompatibilities, remember you can usually work around them in your code using ifdefs: https://doc.qt.io/qt-5/qtglobal.html#QT_VERSION_CHECK
-
to continue, I copied all ~/Qt/6.5.3/gcc_64/lib/ to target Linux Mint 20. Now try to run my app' gives:
./blockingreceiver: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found (required by ./blockingreceiver)
I cannot find this file on both machines, also on my dev. Ubuntu 22.04. Where it should be?
Maybe I should better try to upgrade my target machine to mint 22 ?We are using a combination of
linuxdeploy
andlinuxdeployqt
to create an AppImage. It is quite annoying that you need an older OS version to use these tools...@YuSh said in I've built an app using Qt6, on Ubuntu 22.04. How can I deploy it to other linux, e.g. Mint.:
./blockingreceiver: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.34' not found (required by ./blockingreceiver)
libc.so is the dynamic lib containing the GLIBC implementation. GCC uses a special system to have the functions under the same name for different version of the GLIBC inside the same dynamic library. Your error says, that the libc.so on your system does not contain version 2.34, but only older versions. This is the idea of AppImage (and I would guess for Flatpack and Snap as well) to include all necessary libraries into an image. This includes the libc.so from your build machine. And this is also the reason why you should use an older OS version for building because a GLIBC version newer than the one on the target machine might crash your program.
(An AppImage is a small disk image which contains everything necessary to run the program. When you run the AppImage, it will mount itself and run the program specified. However, it will not run the program directly, but wraps it into a script that first sets the correct environment variables (e.g. LD_LIBRARY_PATH). In theory, you could do the same without the AppImage. Setting environment variables through a script and then launching the program will also not mess with your general environment (Linux might crash if you set the LD_LIBRARY_PATH to point to your own libc.so for your program). BTW, you can use
ldd
on your executable (and dependent dynamic libraries) to figure out which .so files are necessary. This way, you could collect all dependencies manually.) -
If your project is using CMake you can use the CMake Deployment API as advertised at https://www.qt.io/blog/deploying-to-linux-with-cmake