Results 1 to 9 of 9

Thread: Qt binaries too big.

  1. #1
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt binaries too big.

    I'm trying to make the smallest possible Qt binaries with no luck. It turns out that the release versions of QtCore4 is ~1.5MB and QtGui4 ~6MB. You may ask why do you even worry about the size in this era of broadband and cheap storage but I still need to consider slower connection speeds and would like to make the total download size including my application to ~10-12MB.
    Considering the fact that MFC DLL(mfc71.dll) is only 1 MB, Qt binaries look to be too big. I'm using these options to build Qt
    Code:
    qconfigure msvc2005 -debug-and-release -no-qt3support -no-stl -plugin-sql-sqlite -no-mmx -no-3dnow -no-sse -no-sse2 -no-qdbus -no-style-motif -no-style-cde

    I would like to take the shared library approach but if Qt static options can make the binaries smaller, I can switch to the static approach.
    Thanks in advance on any tips to make the Qt binaries smaller.

  2. #2
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt binaries too big.

    Use Qt3? Use Qt2?

    MFC is small, since it's a wrapper arround operating system functions. Qt re-implements all (top level widgets, internal process managment, text rendering etc). You can't make Qt4 smaller.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt binaries too big.

    Quote Originally Posted by William Wilson View Post
    I would like to take the shared library approach but if Qt static options can make the binaries smaller, I can switch to the static approach.
    Static approach might give you a smaller binary, since you can strip away everything you don't use.

  4. The following user says thank you to jacek for this useful post:

    William Wilson (20th January 2008)

  5. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt binaries too big.

    Or you could build Qt yourself, and turn off all the features you don't need. This is not well known, because it's meant for Qtopia Core and not Qt. But because they share the same code base, it still works. Look in the assistant page "Fine-Tuning Features in Qtopia Core" for more information.

    Of course, if you start customizing Qt, and it breaks, don't blame me! But it is an area to look into if you are overly concerned about the size of the libraries.

  6. The following user says thank you to Brandybuck for this useful post:

    William Wilson (20th January 2008)

  7. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt binaries too big.

    You can also disable exceptions, remove widget styles and tweak the makefile to build Qt size optimized instead of speed optimized (-Os vs -O2 for GCC/MinGW). You can also remove features you don't want to use by adding some defines that will remove particular components.

  8. #6
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt binaries too big.

    Quote Originally Posted by wysota View Post
    You can also remove features you don't want to use by adding some defines that will remove particular components.
    Thank you. I take it that you're referring to some documented Qt defines. Can you give some examples?

  9. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt binaries too big.

    It's best to look into or grep Qt source code. They are in a form of QT_NO_DRAGANDDROP.

  10. The following user says thank you to wysota for this useful post:

    William Wilson (21st January 2008)

  11. #8
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt binaries too big.

    Well my install files (static or dynamic build) are less than 4MB compressed as an installer. This is for a small app though of ~7000loc, and includes Qt GUI, Qt Core, Qt SQL, and Qt SVG libs, as well as the microsoft runtime libs. I use NSIS to build my installer and compress using LZMA /solid which gives the best compression. I've also distributed a standalone Qt exe in the past which was statically linked and compressed with UPX to get a final exe size of 1.7 mb.

  12. #9
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt binaries too big.

    As I mentioned above, please look at the page "Fine-Tuning Features in Qtopia Core" in assistant. That is where you can find the documentation on those defines. Really, they are there. Don't let the "Qtopia" name fool you.

Similar Threads

  1. Qt MAc Binaries
    By sunil.thaha in forum Installation and Deployment
    Replies: 1
    Last Post: 30th October 2007, 06:13
  2. Create binaries from QSA
    By Raistlin in forum Qt Programming
    Replies: 2
    Last Post: 30th September 2006, 10:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.