delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/20/03:05:57

From: RadSurfer <RadSurfer AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: (3) HELP Please with C++
Date: Sun, 20 Jul 2003 02:29:54 -0400
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <i7dkhvssmdlj1cgd4ciiog3pusnupjd1fk@4ax.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
X-Complaints-To: abuse AT supernews DOT com
Lines: 54
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

/*  c  */
#include <stdio.h>

int main(void) {

  puts("Hello World\n");

  return 0;
}
- - - - - - - - - - - - - - - - - - - -
/* C++ */

#include <iostream>

int main(void) {

  std::cout << "Hello World!" << std::endl;

}
- - - - - - - - - - - - - - - - - - - -
gcc hw.c -o hw1.exe
gxx hw.cpp -o hw2.exe

.....A 07-19-2003 21:23:18         86   21F13B1D HW.C
.....A 07-20-2003 02:07:50      43520   DD676BF1 hw1.exe
.....A 07-20-2003 01:25:34        106   C353C5DD HW.CPP
.....A 07-20-2003 02:20:50     507145   A5CA7587 hw2.exe
                                      [hex column is CRC32]

OK! 2.953 creates a file roughly 520 bytes smaller for 'C'

Why is the C++ executable  507,145 bytes???

yikes!

More discussion please....
How does one get the EXE size down to something practical?

BTW: A nearly similar Borland BCC32 compile of HW.CPP
  results in 
.....A 07-20-2003 01:42        100   5357307D HW.CPP
.....A 07-20-2003 01:42       4958   95E194DE HW.obj
.....A 07-20-2003 01:42     143360   53C13363 HW.exe

1/5th the EXE size of the DJGPP !!
and only a 4953 object file....sheesh!

-----------------------
I am lost as to why STD::  is required under DJGPP, and
not under other compilers I have.  It would be nice to understand
the reasoning here.... THANKS!

//RadSurfer//

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019