Minimum size of static-linked Qt GUI app?



  • 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?



  • 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 :-)



  • 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).



  • 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 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..."



  • [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.



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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.