PDA

View Full Version : Reduce the size of Qt-compiled software



ct
1st May 2007, 18:06
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.

marcel
1st May 2007, 18:13
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... :)

maxpower
1st May 2007, 18:28
I statically compile my Qt applications which results in a 9+ MB file. I then use upx (http://upx.sourceforge.net/) to compact the exe down to about 3 MB.

mAx

ct
1st May 2007, 18:59
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 ?

ChristianEhrlicher
2nd May 2007, 07:58
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.

Voldemort
2nd May 2007, 14:07
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?

ehamberg
2nd May 2007, 14:21
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.

KShots
2nd May 2007, 15:05
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.