Results 1 to 8 of 8

Thread: Reduce the size of Qt-compiled software

  1. #1
    Join Date
    Feb 2006
    Posts
    91
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Reduce the size of Qt-compiled software

    I have made a basic Qt application which only has one dialog, one text area, and one button but the compiled file requires QtCore4.dll and QtGui4.dll which makes by application around 7-8 mb. Is there any way to redue this size by doing static compilation and perhaps including only those modules that have been used and not the whole QtCore and QtGui api.

    Thanx in advance.
    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reduce the size of Qt-compiled software

    Not really, because the widgets you use require functionality implemented somewhere else, and all lead to QtCore.

    So you can't do anything about this.
    Anyway, 7 Mb is not so big these days...

  3. #3
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Reduce the size of Qt-compiled software

    I statically compile my Qt applications which results in a 9+ MB file. I then use upx to compact the exe down to about 3 MB.

    mAx

  4. #4
    Join Date
    Feb 2006
    Posts
    91
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reduce the size of Qt-compiled software

    but there should be some way around it..can we not just use the ".h" header file of the modules instead of whole <qtcore> and statically compile just the single header that we are using ?
    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

  5. #5
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reduce the size of Qt-compiled software

    Quote Originally Posted by ct View Post
    but there should be some way around it..can we not just use the ".h" header file of the modules instead of whole <qtcore> and statically compile just the single header that we are using ?
    You should learn more about static linking... The linker just uses the parts it needs, nothing more! It does not matter if you include QtCore or single headers.

  6. #6
    Join Date
    May 2007
    Posts
    37
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Reduce the size of Qt-compiled software

    I am making an MSN program under Linux (X11). There are 2 widgets, an SSL connection, an TCP connection, 2 line edits, 1 progressbar, labels and an pushbutton. The whole application is 68.5kb. Maybe it is a Window problem?
    Using Qt version 4.3.0

  7. #7
    Join Date
    May 2007
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reduce the size of Qt-compiled software

    Quote Originally Posted by Voldemort View Post
    I am making an MSN program under Linux (X11). There are 2 widgets, an SSL connection, an TCP connection, 2 line edits, 1 progressbar, labels and an pushbutton. The whole application is 68.5kb. Maybe it is a Window problem?
    But that isn't a statically linked application. Type ldd [your executable] to see all the libraries it (dynamically) links against.

  8. #8
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Reduce the size of Qt-compiled software

    That's one of the main differences between linux thinking and windows thinking. In linux, you ask your clients to have the libraries installed in a central location. In windows, each application must package its own copy of its libraries.

    Yeah, your application is 68.5kb, but then you have Qt itself installed somewhere, so don't forget to add that to your size calculations.
    Life without passion is death in disguise

Similar Threads

  1. Replies: 4
    Last Post: 19th April 2007, 13:17
  2. Replies: 1
    Last Post: 24th October 2006, 16:40
  3. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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.