View Full Version : Very small size

10th August 2010, 19:06
(I'm not sure if it is proper board, but I didn't find better.)
Hi! I'm trying to make a launcher for my game. It is a portable application and so must be a launcher. And launcher must be a very small size, about 1-2MB. I want to use a Qt for it, but I don't know how or if it is even possible to get that size. I tried to use wxWidgets instead (because I'm sure it can be small) but I have big problems with it. Can someone tell me how to make small Qt apps? If it's not possible, also tell me.

11th August 2010, 05:55
I guess its not easy to do that.. The Qt libraries itself take 10-12 MB... So if Qt is already installed on your target machine, may be your application can be of small size :)

11th August 2010, 06:27
You could try to recompile Qt, look for the confg file in src - sorry but I don't remember where it was exactly. In that file you can comment out classes that You don't want to build. That way if You don't use QLabel in your code simply don't build it. Of course this will cripple Your Qt build but gave You smaller dll.
Also there is an issue with LGPL, I don't know if You can recompile Qt that way and still use LGPL, but probably yes.
My smallest redistribution was around 3.5 MB, of course this apply to the system without Qt libs.

11th August 2010, 07:18
Thanks for replies.
Talei, what components did you compile when getting to 3.5MB? Do you think it is possible to get under 2MB (whole app, with static link)? I need only labels, buttons, combo and checkbox (and a file handling, but it's not related to Qt, I think). Do you think I could reach 2MB (after -Os -s, strip, upx and anything what will be neccesary)?

11th August 2010, 08:28
I personally never get anything under 3.5MB. Mostly because I use LGPL, so I redistribute shared upx'ed dlls. And also I have old 2.2GHz AMD 1 Core so I really don't want to waste 3+h to recompile Qt only to get .5MB out of dll's (I'm guessing here).
3.5MB was with static build without phonon, webkits, and some other things, plus upx - don't remember exactly because it was like year and a half ago.
I saw post, from 07 or maybe older (qt mailing list, look google - query small qt or similar), in with person claims that achieve 2.6MB if I remember correctly. In that post is also what he/they changed to achieve that.
Edit. Here is the link to that archive http://lists.trolltech.com/qt-interest/2007-08/thread00675-0.html
Look also for custom configuration of the Qt, it's in src/corelib/global/qfeatures.h and uncomment QT_NO_"Feature_Name"
Also look here: http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/ for compilers flag and difference in the size across different compilers.

Can you get 2MB--? Personally I don't know, probably yes. In past I wanted to do comparison/test on how small exe You can get but, as said earlier, waiting 3h+ for each build is a little ...
But I personally would want to hear from You about how small exe You get after custom compilation, and maybe config parameters.
Best luck.