This is the mail archive of the gcc-help@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]

Re: Why this difference ?


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



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