This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Why this difference ?
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Dileep Krishnan <dileepkrishnan at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 25 Aug 2005 06:30:55 -0500
- Subject: 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