Results 1 to 5 of 5

Thread: Self contained, small as possible app.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Self contained, small as possible app.

    I'm trying to squeeze down a Qt app to be as small as possible. I've tried several custom rebuilds of Qt. All use statically compiled executables in 'release' mode.

    The smallest size of an application compiled in QtCreator (g++) is 9MB, which works fine, but exe compressors don't work on it. It will however fit into a 3MB RAR archive, so not that bad, but not exactly brilliant either.

    If I use Visual Studio with the exact same settings, the app is 4.5MB, works fine, has no dependancy on mingw32, and compresses to a 1.8MB RAR archive or 1.8MB executable.

    Am I seeing the right picture here? Is Visual studio really that good that it can halve the size of the application, or am I missing some flags I can pass to the G++ compiler that QtCreator uses?

    I only use QtCore and QtGUI. I don't care about the size of the executable during development, but I do when the application is compiled in release format.

    I'm quite suprised that even a very simplistic "Hello World!" application is still just under 9MB in size.

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Self contained, small as possible app.

    "Strip" the binary: There shall be an executable "strip" with your mingw-installation. Run it on the binary and see what happens.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Self contained, small as possible app.

    I think 'strip' won't help since he is building in release mode.
    I'm a rebel in the S.D.G.

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Self contained, small as possible app.

    strip does not only remove debug symbols but also unneeded symbols. So it is worth a try. It takes like 5 seconds to try out.
    It's nice to be important but it's more important to be nice.

  5. #5
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Self contained, small as possible app.


Similar Threads

  1. Small Libraries
    By porfirio in forum Installation and Deployment
    Replies: 7
    Last Post: 13th August 2009, 10:16
  2. Small task for Windows programmers
    By wysota in forum General Discussion
    Replies: 23
    Last Post: 29th October 2007, 09:32
  3. tool bar icon size looking small???
    By darpan in forum Qt Tools
    Replies: 7
    Last Post: 31st March 2006, 16:38

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.