Hi Guys,

I have been playing with some C++ code and just compiled a Hello World Console Application with VC++ 6.0. I cannot believe the size is 500kb. In ASM it would have been around 2.5kb. Is this the norm in C++ or have I not compiled it properly? Am using thinking in C++ by Bruce Eckel and here is the sample code:

/: C02:Hello.cpp
// From Thinking in C++, 2nd Edition
// Available at http://www.BruceEckel.com
// (c) Bruce Eckel 2000
// Copyright notice in Copyright.txt
// Saying Hello with C++
#include <iostream> // Stream declarations
using namespace std;

int main() {
cout << "Hello, World! I am "
<< 8 << " Today!" << endl;
} ///:~

Posted on 2003-08-27 03:15:23 by shiny
Try the following:

1. Compile in release mode.
2. Do not use C++/C libraries
3. Remove the linking of C++/C libraries

A simple messagebox code be 1024 bytes.

Take a look at the following link:
Posted on 2003-08-27 03:31:29 by roticv
Thanks roticv:alright:

I will try using your suggestion. By the way the link looks great.

Posted on 2003-08-27 04:03:05 by shiny