www.digitalmars.com         C & C++   DMDScript  

c++ - hello world program too large

reply Can <deep_commander hotmail.com> writes:
hello,
i am compiling a simple hello world program with optimizations
but .exe file is about 370 kb . is it normal?
Jul 31 2008
parent Heinz Saathoff <newshsaat arcor.de> writes:
Can wrote...
 hello,
 i am compiling a simple hello world program with optimizations
 but .exe file is about 370 kb . is it normal?

Depends on your program and what library you use. For example, this program #include <stdio.h> int main() { printf("Hello World\n"); return 0; } copiles to an .EXE of approx. 40 kB This one #include <iostream> int main() { std::cout << "Hello World" << std::endl; return 0; } compiles to an EXE that is 10 times larger. It's the overhad in the statically linked STLPORT lib. - Heinz
Aug 08 2008