[Solved] Qt 5.0.2 static linked - library size and linking time
-
wrote on 22 Apr 2013, 13:00 last edited by
Hello,
i recently build Qt 5.0.2 with static linked libraries. So far, so good...
1st issue: The file size of many build libraries is very huge. I.e. Qt5Quick.lib takes 587 MB of disk space (all Libs in /lib folder together take about 5 GB). Is that "normal"? or is there some way to "strip" the libraries?
(PS: It does only affects the release libs. The debug libs have "normal" size (1/10 size of release libs))2nd issue: The linking of my applikations takes a lot of time, compared to dynamic linked builds. I guess, it depends on the library sizes. Is that right? Then the linking time should be reduced, if the 1st issue is solved.
My environment:
Source package: qt-everywhere-opensource-src-5.0.2.zip
Platform: win32-msvc2008
configure options: -developer-build -nomake docs examples tests demos webkit -debug-and-release -opensource -confirm-license -opengl desktop -mp -static -platform win32-msvc2008 -ltcg -qt-zlib -qt-libpng -qt-libjpegChanges in qtbase/mkspecs/win32-msvc2008/qmake.conf for static build:
old: QMAKE_CFLAGS_RELEASE = -O2 -MD
old: QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
old: QMAKE_CFLAGS_DEBUG = -Zi -MDdnew: QMAKE_CFLAGS_RELEASE = -O2 -MT
new: QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
new: QMAKE_CFLAGS_DEBUG = -Zi -MTd -
wrote on 23 Apr 2013, 10:55 last edited by
I'll try to answer myself:
I left out the -ltcg configure flag. As far as I understand, this flag enables the -GL (whole program optimization) compiler flag in release builds, which increases the lib size dramatically.
Rebuild is currently in progress, but until now build release libs hafe 1/3 the size of the debug libs.
Looks good so far... -
wrote on 24 Apr 2013, 07:19 last edited by
Build is done now. Lib sizes are as expected and linking time is as usual.
1/3