delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/18/16:02:06

From: okapi AT ezonline DOT com (Matt Gulden)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Why does gcc make such big binaries?
Date: Sun, 18 May 1997 18:10:54 GMT
Organization: <none>
Lines: 38
Distribution: world
Message-ID: <5ln5lu$i5l$1@news3.microserve.net>
References: <Pine DOT OSF DOT 3 DOT 91 DOT 970518132348 DOT 61A-100000 AT hermes DOT otago DOT ac DOT nz>
Reply-To: okapi AT ezonline DOT com
NNTP-Posting-Host: 206.228.74.142
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Richard Collins <rcollins AT hermes DOT otago DOT ac DOT nz> wrote:

>I've just started coding in C with gcc.  For my first program I wrote the 
>originsl little program:

>main() {
>	printf("Hello World\n");
>       }

>Which worked well, but I was shocked to see the program was about 80k.

>So I tried:

>Main(){}

>Which compiled to 60k.

>I tried the equivilent programs in turbo pascal, and got 2.4k and 1.6k 
>respectivly.

>I'd greatly appreciate if someone would tell me.  What is all this code 
>that is being generated and is there any way I can cut it down somehow?

>Thanks for your time,

>Richard Collins <rcollins AT hermes DOT otago DOT ac DOT nz>

hello, I had the same question a little while ago, although I'm not
sure exactly why it makes such big exe's, other than something about
it including debug info or something, but I know you can add -s as a
command line parameter when compiling to not add this stuff, or you
can type 
strip program.exe
to do the same thing (I think it's the same)
--
Matt Gulden -- thrillhaus AT ezonline DOT com
http://www.ezonline.com/okapi/ogwd

- Raw text -


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