Reputation: 5274
I am currently writing code in Qt. How to compile the code statically?
From Qt document I came to know the following step
1) Visual Studio 2008 -> commandPrompt -> QtDir -> configure -static -> nmake
But, it took 17 GB and at the end it exited before the completion stating that "the space is not enough".
Is there any simple way to compile the Qt application as a stand alone program?
Upvotes: 5
Views: 3880
Reputation: 49
For more modern versions of Qt (i.e. Qt 6.*), the size-reduction flags mentioned above will not work. See my answer here for a comprehensive list of ways to reduce compile time/size.
Hope this helps!
Upvotes: 0
Reputation: 76529
You have already used the only way possible: compiling the source as static.
Some things that have a very large impact on disk size (which seems to be the problem here), with corresponding configure arguments:
-release
-no-webkit -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples
no-ltcg
These should help keep the build size to a minimum.
Upvotes: 8