Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
124 views
Welcome To Ask or Share your Answers For Others

1 Answer

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:

  1. Disable debug: -release
  2. Disable modules you don't need, especially QtWebKit: -no-webkit -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples
  3. Disable LTCG support, which has the nasty side effect of generating huge static libraries: no-ltcg

These should help keep the build size to a minimum.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...