compiled program too big

Andrea 'fwyzard' Bocci fwyzard-gcc@libero.it
Mon Jun 30 16:18:00 GMT 2003


At 01.01 30/06/2003 -0700, Insanely Great wrote:
>Greetings
>
>I am complete newbie to the world of programming.
>Write my first console program which is around 11KB.
>basically it takes a string as a first parameter and
>does some stupid processing to it.
>
>Works both in VC++ 6.0 in windows and gcc in RH Linux
>7.2
>
>The problem is when I comile with VC++ in Release mode
>the output exe is 44KB.
>
>when i comile the same program in linux using gcc -
>
>gcc -O2 First.cpp
>
>the resulting program is 126KB....why? am i missing
>some option.
>
>is there any option to tell gcc to compile it in
>something like RELEASE MODE in VC++.
>
>sorry for my ignorance and thanks in advance.
>
>insane

Try stripping the output executabled:

strip executable_file

This should remove all the sybols from the exe - it halved the size of a 
small test program in my cygwin environment, ven when no -g was specified 
on command line.

.fwyzard. 



More information about the Gcc-help mailing list