How to reduce Qt Application Binary size ?
I have compiled Qt for Embedded Linux platform statically.
I have also used qconfig to remove some of the functionality to reduce the size of the Qt Binary.
But i haven't gain much size difference between above changes.
Currently my Qt Application size id ~8MB after the some changes i got ~214KB size reduction BUT is there any way i can reduce the size my Qt Application to ~5MB ? Any change in configure command ? I have given following configuration command for embedded linux.
Give me some idea to reduce the size of my Qt Application.
How can i achieve size reduction ?
Maybe there's a linker option that makes sure only code that is actually used is included. Else you will have to remove everything and add certain components until your application can be built again.
which linker option to set ?...
Another way to reduce the size ?
[quote author="neel2818" date="1305105920"]which linker option to set ?...[/quote]Don't know about that.
There is also the choice to compress the binary. Look at "upx":http://upx.sourceforge.net/ , it could be available also in linux repositories
Some time ago I heard about that compiler option: gcc has the ability to search for functions that call other functions that... (etc), but skipping those other included in the same file but never called.
I remember finding this option in man gcc, and being unable to finally use it... Maybe the links below offer some help.
(...) something along the lines ld -Ur -o mylib.o [components] (...)
"Building Qt Static (and Dynamic) and Making it Small with GCC, Microsoft Visual Studio, and the Intel Compiler":http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
If you want to use static builds, make sure you use the correct license options.
Afaik (I'm not a lawyer!) you have to have a commercial license or your software must be GPL to use static linking.
IANAL either, but AFAIK, as long as you provide the option to re-link against another version of the library, you are allowed to use static linking using the LGPL Qt libraries. And no, that is probably not too easy to do, but I think Gerolf's comment is incorrect.