Reputation: 83
I got an app, that is ready to release. On windows, I simply type 'windeployqt.exe MyApp.exe' inside 'release' folder of app build in special qt cmd. I'm trying to do the same on kali linux (I dont have time to install other deb based distro). I'm searching for solution for three hours, and I cant find anything good. So, how to make application executable on other linux computer without Qt Creator installed?
Upvotes: 0
Views: 1240
Reputation: 3143
There are many ways to deploy Qt applications on Linux. AppImage created with the help of linuxdeployqt or linuxdeploy-plugin-qt is one option, perhaps even the simplest one but it has its drawbacks. From my personal experience I can think of two:
Other packaging options for Linux include:
Linking the application with static version of Qt. It is the approach used e.g. by Telegram. The instructions can be found here. Beware, however, that using this approach for commercial closed source applications generally requires commercial Qt license. Probably it is possible to get away with LGPL but it would be very cumbersome: you'd have to provide customers with compiled object files so that they can replace them and re-link the app. Also beware of the fact that if the application you intend to create is going to be an open source one, the maintainers of Linux distributions would generally not agree to distribute statically linked applications - that violates the basic rules for many distros according to which applications should not bundle their dependencies but instead should use the system provided libraries. It is important from e.g. security perspective - if some security threat is found in Qt in future, it can be fixed within a Qt library itself and all applications using that library would then also be secure - something not that easily achievable with application built with static version of Qt.
Creating native packages for target systems - i.e. deb packages for Debian/Ubuntu systems and their derivatives, rpms for Fedora, OpenSUSE and other rpm-based distros, PKGBUILD for Arch Linux and various other kinds of packages for various other distros, hundreds of them. The advantage is good integration with the rest of the system: native themes etc. Also you get all the advantages of the security fixes for shared libraries.
Using flatpak or snap packages - these are modern app packaging formats developed by RedHat and Canonical respectively with the goal to simplify the management of app's dependencies.
Using the generic approach using shared libraries - with this approach you'd need to package your app as an archive containing a directory containing you app and all its dependencies in the form of shared libraries - something similar to the approach of deployment on Windows where you put the dlls alongside the app.
I would recommend trying an AppImage first and then creating native packages for target distros.
Upvotes: 1