This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reducing the size of the binaries


Hi i'm compiling a very simple program that consists
in 3 files:
-a .h file (20 lines of code), which declares a class
and includes iostream
-a .cpp file (33 lines of code), including only the .h
file.
-main.cpp (11 lines), which includes only the .h.

So, as you can see, its a very very simple program
with 1 class and a main. I'm just beginning a proyect.
When I compiled this using the following command line:
g++.exe -c ... -o ... -I ... -DDEBUG -Wall -pedantic
-g -ansi -fno-inline

the result was:
a .o file for the main.cpp (803 KB)
a .o file for the .cpp (class definition) ( 810 KB)
the .exe file (1251 KB)

I'm using gcc 3.2 (mingw32)
I cannot understand why are they so big in size... I
think im doing something bad, but I don't know what...

If I include stdlib.h in any file, it results in a 2
MB exe.
I have a lot of programs made with C++ and their
binaries are smaller than mine, and mi program has
less than 100 lines. What's wrong?

Thanks in advance...



	
	
		
___________________________________________________________
100mb gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]