This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: compiled program too big
- From: Mihnea Balta <dark_lkml at mymail dot ro>
- To: Insanely Great <insanelyg at yahoo dot com>,gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Jun 2003 11:33:56 +0300
- Subject: Re: compiled program too big
- References: <20030630080142.18393.qmail@web41707.mail.yahoo.com>
Try using this:
g++ -fno-exceptions -O2 First.cpp -Xlinker --strip-all
My results on a 2-line .cpp source:
[11:32am]/tmp# g++ -O2 test.cpp
[11:32am]/tmp# ls a.out
-rwxr-xr-x 1 root root 11161 Jun 30 11:32 a.out
[11:32am]/tmp# g++ -fno-exceptions -O2 test.cpp -Xlinker --strip-all
[11:32am]/tmp# ls a.out
-rwxr-xr-x 1 root root 2572 Jun 30 11:32 a.out
On Monday 30 June 2003 11:01, 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
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> ---------------------------------------------------------------------------
>-- Gaseste-ti perechea si castiga o saptamana la Poiana -
> http://dating.acasa.ro
-----------------------------------------------------------------------------
Gaseste-ti perechea si castiga o saptamana la Poiana - http://dating.acasa.ro