PDA

View Full Version : Building dependency free standalone QT 4 applications



ia32
29th January 2007, 19:27
How can I build QT 4 applications that doesn't depend on mingwm10.dll and QT4 dll files? I've seen QT3 programs (like SQLite Database Browser) which work as standalone exe without requiring mingwm10.dll or QT library DLLs.

jacek
29th January 2007, 20:25
http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Windows

ia32
29th January 2007, 23:21
I just built a static exe for a simple application (which has only a a "quit" pushbutton). The filesize is unbelievable, 52.1 MB!!! Is it normal for static QT4 executables? :confused:

And how do I revert to default settings? Is just undoing the changes to qmake.conf and running ('configure' without any paramenter + mingw32-make sub-src) enough?

jpn
29th January 2007, 23:53
The filesize is unbelievable, 52.1 MB!!! Is it normal for static QT4 executables?
Sounds like you have built a debug version. Try rebuilding after "qmake -config release".

ia32
30th January 2007, 06:12
After "qmake -config release" it's much smaller, but still 7.2 MB :(

Is there any way to make static exes of a saner size?

BTW, thanks to everyone for help.

jacek
30th January 2007, 15:26
Try stripping the executable or use UPX.

ia32
31st January 2007, 02:47
Which executable stripper should I use? Something like StripReloc (www.jrsoftware.org/striprlc.php)?

jacek
31st January 2007, 17:27
Which executable stripper should I use?
It really doesn't matter, as long as it works well. The one you have found works a bit differently, so you can try it together with, for example, strip.exe that comes with MinGW's binutils package.