Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Minimum size of static-linked Qt GUI app?
QtWS25 Last Chance

Minimum size of static-linked Qt GUI app?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 9.0k Views
  • 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.
  • L Offline
    L Offline
    leonidwang
    wrote on last edited by
    #1

    Hi, all.

    I've compiled static Qt lib and created a simple GUI app using this static lib.
    The size of the program I got is about 5MB, which still seems a bit too large to me.

    If I change to msvc2008 to recompile Qt lib with some optimization options(currently using msvc2005 with default compile options), will I get smaller binary? And what's the minimum size of a static-linked very simple Qt app with UI? any guess?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soroush
      wrote on last edited by
      #2

      I think size of your application will be a bit greater than qtgui lib.
      I've compiled Qt using msvc2010 staticlaly. don't remember size of the lib but will tell you an hour later (when I go home :-)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        loladiro
        wrote on last edited by
        #3

        You could also just pick and choose all the classes from Qt Gui you need and compile those as a library (this is a bit tricky, but if you don't use all components, it's a great improvement in size).

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          No, it will be much smaller then GUI lib. Only those things, that are used are added to the exe, the rest should be skipped.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leonidwang
            wrote on last edited by
            #5

            [quote author="loladiro" date="1312878756"]You could also just pick and choose all the classes from Qt Gui you need and compile those as a library (this is a bit tricky, but if you don't use all components, it's a great improvement in size).[/quote]

            oh, that's really tricky.
            I bet anyone who tried that would get tons of "undefined reference..."

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leonidwang
              wrote on last edited by
              #6

              [quote author="Gerolf" date="1312878800"]No, it will be much smaller then GUI lib. Only those things, that are used are added to the exe, the rest should be skipped.[/quote]

              Yes.
              In my case, the static QtCore lib is about 14MB, QtGui lib is 36 MB, while a simple static-linked GUI program consumes only 5MB.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                loladiro
                wrote on last edited by
                #7

                Are you sure that that are not the debug libs? My QtCore is 2MB and my QtGUI is 8MB

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  leonidwang
                  wrote on last edited by
                  #8

                  I "think" they are release libs because I configured with release option on.
                  And I'm talking about static lib, 2MB QtCore and 8MB QtGUI seems unbelievable to me...

                  Anyway, what I'm caring about is the size of the final static-linked app.

                  1 Reply Last reply
                  0

                  • Login

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