gcc3.2 [Archive] - C Board

PDA

View Full Version : gcc3.2


Jaguar
12-21-2002, 02:34 AM
I think that gcc3.2 produces very big binaries.
Even very small program likes cout<<"Hello world.\n";
Binary is as big as 300-400 Kb.
What happen? How can I minimize it?

One more question, I usually write myheader.h. If I want to compile the header (just for check syntax or mis-spelling, not to run), how can I do with gcc/g++ (which options)?

Thanks in advance

Jaguar
12-23-2002, 10:29 AM
(I guess you misread the file size) - 4MB (4090156b) for a simple ``hello world''!
I put some commands

$ du my_bin
438 my_bin
$
$ du -b my_bin
448512 my_bin

I dont think I misread it. And I tried...

$ nm my_bin
I guess tonnes of library are in my_bin.

Captain Penguin
12-23-2002, 10:38 AM
Uhh, my executables aren't nearly that large when I compile with gcc 3.2. For example, an SDL prog I have is 32kb, which includes SDL.h, iostream, and my own matrix library.

I'm not sure why you are all getting such large files.

Jaguar
12-23-2002, 10:58 AM
What's your cout-size if you compile with ``-s''?
$ g++ -s -o my_bin my_file.cpp
$
$ du -b my_bin
219316 my_bin

Jaguar
12-23-2002, 11:38 AM
Yes I still have gcc2.95, I cant remember how many C/C++ compilers I have (may be 3 compilers per one partition, I have total 4 partitions. :p Joking dont believe me. :p But now I use only gcc3.2 on cygwin and gcc2.96 on redhat7.2. Once I was told to use gentoo linux and FreeBSD but I am scared.
Anyway, I shall try, if I have a chance.
Thanks