delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/24/20:50:23

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Why is compiled a lot bigger than src?
Date: Mon, 24 Mar 1997 22:40:43 GMT
Organization: Oxford University
Lines: 20
Message-ID: <333701a1.2415054@news.easynet.co.uk>
References: <5h63v1$img AT news-central DOT tiac DOT net>
NNTP-Posting-Host: foot.easynet.co.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 24 Mar 1997 14:43:45 GMT, gecko <gecko AT shell1 DOT tiac DOT net> wrote:

>When I was using TC++ I had a src that was only 14k and would compile to
>22k, thru DJGPP it is compiling to 114k. I used gcc -o c.exe c.src and
>tried the optimizations but nothing helps...I might be naive or somehting,
>ok thank you

It is likely that under DJGPP a lot of library code is being linked
in. There is also a stub which is required to allow your program to
use protected mode, and interface with the DPMI server. Also, by
default a certain amount of debugging information is included in the
EXE file - try putting `-s' on your linking command line to gcc.

Incidentally, gcc uses your source file extensions to determine what
it should do with the file; for C and C++ programs you should use .c
and .cc respectively (you can also use .C (capital) for C++ programs).
There are others for assembler code, object files, etc.

-- 
George Foot

- Raw text -


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