Why this difference ?

Eljay Love-Jensen eljay@adobe.com
Thu Aug 25 11:31:00 GMT 2005


Hi Dileep,

The difference, in part, is because you are ignoring that a large portion of
both programs is the Standard C Library and the Standard C++ Library.

On Debian Linux, those libraries are in shared object (.so) libraries.  You
can see them by using the 'ldd' command on your binary executable.

On Windows XP with MinGW, those libraries are linked in statically (if I
recall correctly).

The C++ I/O Stream subsystem is pretty beefy (and has a lot more capability)
than the C I/O facilities.  And all the C++ I/O Stream facilities are
present in a C++ program, even if you don't use std::cin, std::cout,
std::cerr (unless you take explicit measures to disable them, which is a
non-trivial exercise).

Despite all that, there may be tricks one can employ to reduce the size of
the binary executables, on both platforms.

Did you 'strip' the executables?

HTH,
--Eljay




More information about the Gcc-help mailing list