Sorry for the extra topic.
I am new in this forum and discovered NO possibility to reply
an existing topic.
After initiating the new topic I got the reply-buttons visible in all posts. Strange !!!!
Last edit: Ad van Gerwen 2012-12-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could blame the C++ headers and libraries for being a bit on the fat side, but complaints like that aside, there are quite a few ways to fix this:
You can remove any unused header information from exes using the -s command. It can be found under Tools >> Compiler Options >> Settings >> Linker for non-project compilations and Project >> Project Options >> Compiler >> Linker for project compilations. This is the most effective measure. Beware that debugging information is stripped too, so you won't be able to debug your program.
Using C headers instead of C++ ones will help a great deal too, but I understand that's usually not an option.
You can tell the compiler to optimize the assembly for size, by using -Os. Please check the 'Optimization Level' option for this.
You can decide to dynamically link library data by removing '-static-libgcc' and the other -static flag from Tools >> Compiler Options >> General. This will shrink the exe, but you will be forced to provide DLLs when you need to run your exes.
I hope I could be of help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
when i compile hello world program, the exe file really large ~5MB anyway to optimize this ?
See my post in file-size.
Sorry for the extra topic.
I am new in this forum and discovered NO possibility to reply
an existing topic.
After initiating the new topic I got the reply-buttons visible in all posts. Strange !!!!
Last edit: Ad van Gerwen 2012-12-10
You could blame the C++ headers and libraries for being a bit on the fat side, but complaints like that aside, there are quite a few ways to fix this:
I hope I could be of help.
Also, here's a Makefile that will automatically run UPX (Ultimate Packer for eXecutables after your Dev-C++ Project is built.. can reduce size by an additional 70%+.
To use, add to
Project|Project Options|Makefile|Include the following files into Makefile
.Last edit: MikeDNC 2013-09-19