Package app as .AppImage after building with Qt Creator
-
I am trying to build and package QGroundControl (QGC) into a standalone .AppImage file for running on Linux (Ubuntu) systems. However, this issue is specific to QT, not QGroundControl.
My issue is this: I install Qt Creator with the online installer with the desktop gcc complier for 5.15.2 as described in the QGC developer docs. On Ubuntu 20.04 with glibc 2.31 I can use Qt Creator to build QGC successfully. Then I try to package it into an .AppImage with LinuxDeployQT. This fails and says I must have glibc <= 2.27.
So I got an installation of Ubuntu 18.04. This has glibc 2.27 by default. The problem with Ubuntu 18 with glibc 2.27 is when I install QT Creator with 5.15.2 and try to run QT Creator I get an error saying glibc_2.28 is not found.
If >= 2.28 is required to build with Qt Creator, but <= 2.27 is required to package into an .AppImage with LinuxDeployQT how is building and packaging supposed to be done for .AppImage files?
Thank you for your help!
-
I am trying to build and package QGroundControl (QGC) into a standalone .AppImage file for running on Linux (Ubuntu) systems. However, this issue is specific to QT, not QGroundControl.
My issue is this: I install Qt Creator with the online installer with the desktop gcc complier for 5.15.2 as described in the QGC developer docs. On Ubuntu 20.04 with glibc 2.31 I can use Qt Creator to build QGC successfully. Then I try to package it into an .AppImage with LinuxDeployQT. This fails and says I must have glibc <= 2.27.
So I got an installation of Ubuntu 18.04. This has glibc 2.27 by default. The problem with Ubuntu 18 with glibc 2.27 is when I install QT Creator with 5.15.2 and try to run QT Creator I get an error saying glibc_2.28 is not found.
If >= 2.28 is required to build with Qt Creator, but <= 2.27 is required to package into an .AppImage with LinuxDeployQT how is building and packaging supposed to be done for .AppImage files?
Thank you for your help!
Did you find a solution?
The linuxdeployqt author, probonopd, commented on Feb 19
Qt 6 does not run on all still-supported Linux distributions at this point. linuxdeployqt can only start supporting Qt 6 once it is compatible to all still-supported Linux distributions. In the meantime, you can try whether AppImageBuilder can do it.
https://github.com/probonopd/linuxdeployqt/issues/340
The result of this policy is our app is not available on any linux distribution. We have an application that is released on Windows, Mac, iOS and Android. We have a handful of customers requesting Linux support. The app runs fine from QtCreator on Linux, so why not? If there was a way to do it, no more complex than the Mac or Windows release, then it would be supported, but I have wasted too much time on it already!
-
Did you find a solution?
The linuxdeployqt author, probonopd, commented on Feb 19
Qt 6 does not run on all still-supported Linux distributions at this point. linuxdeployqt can only start supporting Qt 6 once it is compatible to all still-supported Linux distributions. In the meantime, you can try whether AppImageBuilder can do it.
https://github.com/probonopd/linuxdeployqt/issues/340
The result of this policy is our app is not available on any linux distribution. We have an application that is released on Windows, Mac, iOS and Android. We have a handful of customers requesting Linux support. The app runs fine from QtCreator on Linux, so why not? If there was a way to do it, no more complex than the Mac or Windows release, then it would be supported, but I have wasted too much time on it already!
@bee65 said in Package app as .AppImage after building with Qt Creator:
The result of this policy is our app is not available on any linux distribution.
You don't strictly need linuxdeployqt. Try manual deployment: http://www.tripleboot.org/?p=138#Linux
In summary:
- Provide your executable
- Provide all the required Qt *.so files
- Ensure that your executable can find the *.so files
-
On Windows my app is deployed with 556 files in 56 folders. It doesn't seem like it would be a good plan to set that up manually, given my limited understanding of how it all works! I suspect many of the libraries are plugins, and would not show up with the ldd command.
Instead of trying to work out what libraries are needed, I thought I would try just shipping the whole darn lot. I took a copy of the Qt/6.2.3/gcc_64 folder, deleted a bunch of stuff that is not runtime-related, did the chrpath thing, and it seems to work fine. The compressed tar file is only 48MB, which is actually smaller than my Mac deployment bundle!
I just need to set up an icon and a desktop file and I think we may be good!
-
On Windows my app is deployed with 556 files in 56 folders. It doesn't seem like it would be a good plan to set that up manually, given my limited understanding of how it all works! I suspect many of the libraries are plugins, and would not show up with the ldd command.
Instead of trying to work out what libraries are needed, I thought I would try just shipping the whole darn lot. I took a copy of the Qt/6.2.3/gcc_64 folder, deleted a bunch of stuff that is not runtime-related, did the chrpath thing, and it seems to work fine. The compressed tar file is only 48MB, which is actually smaller than my Mac deployment bundle!
I just need to set up an icon and a desktop file and I think we may be good!
@bee65 said in Package app as .AppImage after building with Qt Creator:
Instead of trying to work out what libraries are needed, I thought I would try just shipping the whole darn lot. I took a copy of the Qt/6.2.3/gcc_64 folder, deleted a bunch of stuff that is not runtime-related, did the chrpath thing, and it seems to work fine.
Great thinking, and congrats on your progress!
In essence, you have done the Linux version of the "Quick and dirty" deployment described at https://wiki.qt.io/Deploy_an_Application_on_Windows
Hopefully this diagram provides a bit of clarity to the deployment process: