I have a trivial \"Hello world\" C++ program that is compiled to 500kB executable by MinGW g++ compiler under Win XP.
Some say that is caused by iostream li
You should be using -O for optimization. Add "-O{level}" to your compiler args and it will optimize for either speed or size. Check the docs for your compiler.
You could also have debugging symbols enabled. Stripping those will also make it smaller.