Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] Qt 5.0.2 static linked - library size and linking time

    Installation and Deployment
    1
    3
    2288
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      danielesd 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-libjpeg

      Changes 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 -MDd

      new: QMAKE_CFLAGS_RELEASE = -O2 -MT
      new: QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
      new: QMAKE_CFLAGS_DEBUG = -Zi -MTd

      1 Reply Last reply Reply Quote 0
      • D
        danielesd 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...

        1 Reply Last reply Reply Quote 0
        • D
          danielesd last edited by

          Build is done now. Lib sizes are as expected and linking time is as usual.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post