Mail Archives: djgpp/1999/10/22/13:34:32
On 21 Oct 99, at 22:04, Katy <kcdixon AT hotbot DOT com> wrote:
> I am able to compile both c and c++ code, however, all my exe's that
> are compiled with gpp are HUGE!
>
> For example a simple "Hello World" exe, is ~ 268,000 KB.
> I use the following commands to compile the hello.cpp
> gpp -c -o hello.o hello.cpp
> gpp -o hello.exe hello.o
>
> How can I make my exe's smaller, is there a switch that I can use to
> do this.
Greetings Katy,
There are two ways to reduce the exe file size.
1. to add the switch -s to your command line.
for example
'gcc hello.cpp -o hello.exe -s'
This will cause the linker not to put debug info in the exe.
2. run strip.exe on the created EXE.
example try running "strip hello.exe" wich will remove all debug
info from the exe.
Section 8.13 of the DJGPP FAQ has more if you are interested.
If you further want to make your EXE's smaller You can try getting
one of the following executable file compressors UPX or DJP.
Bye!
Kalum Somaratna.
- Raw text -