Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] Qt 5.0.2 static linked - library size and linking time
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 1 Posters 2.5k Views 1 Watching
  • 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 Offline
    D Offline
    danielesd
    wrote on 22 Apr 2013, 13:00 last edited by
    #1

    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
    0
    • D Offline
      D Offline
      danielesd
      wrote on 23 Apr 2013, 10:55 last edited by
      #2

      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
      0
      • D Offline
        D Offline
        danielesd
        wrote on 24 Apr 2013, 07:19 last edited by
        #3

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

        1 Reply Last reply
        0

        1/3

        22 Apr 2013, 13:00

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved