Take the 2-minute tour ×

I am trying to build Qt because it is required for Visual Studio 2010. The build script (configure.exe) is quite straightforward but by default it takes ages to compile. After waiting for an hour on a fast notebook with an SSD, I've given up (using no flags, just configure.exe).

What are the recommended flags for a basic, lightweight Qt application? I mean for someone learning Qt, who doesn't need WebKit and so on.

I've collected the most useful links I found:

The reference page for Qt configure: http://doc.qt.nokia.com/4.7/configure-options.html

Ben's advice from this question: Building Qt 4.5 with Visual C++ 2010

-no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast

Rubenvb's advice from this question: How to compile qt as static

  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
share|improve this question
@Peter I can't find no-ltcg flag in configure, I tested this on Qt 4.7.4. –  SIFE Dec 23 '11 at 10:39
add comment

1 Answer

up vote 4 down vote accepted

That should be ok. Everything beyond webkit is just micro-optimization, if it comes to build times (webkit is huge). I wouldn't set -nomake tools when you want to explore Qt, as you might want to use those tools.

share|improve this answer
Thank you! After a lot of experimenting, I've settled down on: configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg The only one I'm not so sure about is -no-ltcg. Does it have any side effect? –  zsero Apr 8 '11 at 12:36
add comment

Your Answer


