Results 1 to 8 of 8

Thread: Small Libraries

  1. #1
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Small Libraries

    Hi! I want to use Qt for make a small application.

    But Qt runtime is huge!
    I need QtCore4.dll and QtGui4.dll, but together they are 13,3MB!
    So my application wont be nomore a small application

    Is there a way to compile this dll's removing support for some stuff and make them smaller?

    What about Static Linking, will it make it smaller?
    The advantage would be that we could UPX it, i think...
    kdewin-installer-gui-latest.exe from kdewin is 2,23MB and it uses Qt

    If anyone faced the same problem, could you post your configuration for configure.exe?

    Either for reducing dll's size or for make minimal static libraries.

    Thank's in advance.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small Libraries

    Using the dll you will always be stuck with this, unless you disable stuff. Smart static linking might indeed reduce the total size. Note that to do that you have to either release your code under GPL or have a commercial license.

  3. #3
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Small Libraries

    Quote Originally Posted by franz View Post
    Using the dll you will always be stuck with this, unless you disable stuff. Smart static linking might indeed reduce the total size. Note that to do that you have to either release your code under GPL or have a commercial license.
    I release my code under GPL

    Removing suport for databases, image formats, sql drivers, webkit, etc will decrease the library size or just the make the plug-ins not being build?

    My application is quit simple and small, dont need many stuff.

  4. #4
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small Libraries

    Quote Originally Posted by porfirio View Post
    Removing suport for databases, image formats, sql drivers, webkit, etc will decrease the library size or just the make the plug-ins not being build?
    None of those are in the QtCore or QtGui modules. You really need to cut on core and gui stuff if you wish to reduce size.

  5. #5
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: Small Libraries

    Quote Originally Posted by franz View Post
    None of those are in the QtCore or QtGui modules. You really need to cut on core and gui stuff if you wish to reduce size.

    Yes, that is what i was thinking...

    Any hints on what i can do to reduce its size?

  6. #6
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Small Libraries

    Well, if you release your project under GPL anyway the easiest solution would be to build a static version of Qt and link the binary release of your application against that static Qt.

    If you do that, only the parts of Qt that you are using are included in your binary, and you do not need to ship any Qt libraries for it to work.

  7. #7
    Join Date
    Jul 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: Small Libraries

    Quote Originally Posted by rexi View Post
    Well, if you release your project under GPL anyway the easiest solution would be to build a static version of Qt and link the binary release of your application against that static Qt.

    If you do that, only the parts of Qt that you are using are included in your binary, and you do not need to ship any Qt libraries for it to work.
    Yes, so i should copy the Qt folder and run configure and make

    configure.exe
    -release
    -static
    -opensource
    -no-exceptions
    -no-qt3support
    -no-opengl
    -no-qmake

    Is there anything more i can remove for make it even smaller?

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

    Default Re: Small Libraries

    Yes.

    First call strip -s on the executable
    then use upx to compress the executable
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Qt + Eclipse + MinGW + Windows: How to include libraries?
    By jambrek in forum General Programming
    Replies: 3
    Last Post: 19th December 2007, 13:57
  2. Replies: 2
    Last Post: 8th March 2007, 22:22
  3. Qt 3.3 libraries
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st December 2006, 17:25
  4. Standardization on libraries
    By brcain in forum General Discussion
    Replies: 13
    Last Post: 16th August 2006, 22:56
  5. Replies: 4
    Last Post: 7th March 2006, 08:52

Tags for this Thread

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.