I followed all the steps successfully as mention in the Qt documentation:
But I still couldn't make static Qt application, the executable generated by the above documented steps still needs Qt shared objects on other system.
Any ideas?
Qt's support for different Linux platforms is extensive and mature. To download and install Qt for Linux, follow the instructions on the Getting Started with Qt page.
Re: How to deploy qt applications in raspberrypi 1) Build your Qt application with statically linked Qt libraries. 2) Use the normal shared Qt libraries and package your program as a Raspbian package, . deb, that uses the Raspbian Qt libs. 3) Use normal shared Qt libraries but package them with your executable, in a .
You need to deploy the application, for this purpose I use the utility cqtdeployer
This utility itself collects all the necessary dependencies of your application and you do not have to spend your time on it, or you can automate this process.
You can install from github releases (Windows)
or
from snapstore (Linux)
sudo snap install cqtdeployer
You can use as follows:
%cqtdeployer% -bin myApp -qmake path/to/Qt/5.x.x/build/bin/qmake.exe -qmlDir path/to/my/qml/files/dir
cqtdeployer -bin myApp -qmake path/to/Qt/5.x.x/build/bin/qmake -qmlDir path/to/my/qml/files/dir
path/to/Qt/5.x.x/build/bin/qmake - This is the way qmake is used to build your program.
path/to/my/qml/files/dir - this is the path directly to your qml file (which you wrote)
And Run application with sh script (Linux) or exe (Windows)
If you'll use the version from snap then make sure that you have all the permissions.
If you need use windows version just install application from installer
If you want create a simple installer for you application just add qif option for command of cqtdeployer. Example :
cqtdeployer -bin myApp -qmake path/to/Qt/5.x.x/build/bin/qmake -qmlDir path/to/my/qml/files/dir qif
Details on all the intricacies of cqtdeployer can be found on the official wiki project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With