PDA

View Full Version : How to pack and deploy Qt5.2.1 applications



mp33919
20th August 2014, 22:14
After months of installing Qt5.2.1, my first Qt5.2.1 program finally is finished. Now I need to deploy it to the user's Centos 6.5 machine that has no Qt5.2.1 and gcc4.9 installed. (only the Qt3.X and gcc4.4.7-4 in user's machine)
I tried to follow the instructions of "Deployment" provided by Qt's assistant. But I have tons of thing could not figure out by myself, I need some helps. Let me ask the first two questions:

1. How do I know my Qt5.2.1 is "statically build"? If not, what do I need to do to install static build Qt5.2.1? I installed Qt5.2.1 from the file "qt-opensource-Linux-x64-5.2.1.run
2. Since Qt5.2.1 applications could be build by using Qt Creator's, how could I "modified" the configurations so that I could build a statically linked executable?

Thanks in advance.

anda_skoa
21st August 2014, 09:47
The default build of Qt is dynamic libraries, so you'll have to build Qt with the static option enabled.

You then add this version of Qt as an option in QtCreator (i.e. create a new "kit").
Since the target is using an earlier version of the compiler it might be best to build in a similar environment.

Alternatively to a static build you could consider bundling the dynamic libraries.

Cheers,
_

mp33919
21st August 2014, 15:11
Thanks anda_skoa.

Questions is how to build Qt with the static option enabled?
This was what I did:
run the file: qt-opensource-Linux-x64-5.2.1.run
"Welcome to the Qt 5.2.1 Setup Wizard"
[Next>]
"Installation Folder"
/home/Qt5.2.1
[Next>]
"Select Components
[Select All] [Next>]
"License Agreement"
[Qt Installer LGPL Agreement] Accept [Next>]
"Ready to Install"

If I press [Install], the Qt5.2.1 will be built. But till to this point, I see no place to set "static enable option". So how can I set "static enable"?

Thanks again.

anda_skoa
21st August 2014, 16:38
As I said you have to build Qt yourself

http://qt-project.org/doc/qt-5/configure-options.html

Cheers,
_