From: CWWIS1 Newsgroups: comp.os.msdos.djgpp Subject: Re: EXE size Date: 8 May 1997 07:57:23 GMT Organization: Monash University Lines: 38 Message-ID: <5ks113$k59$1@towncrier.cc.monash.edu.au> References: <5kokdm$seh$1 AT news3 DOT microserve DOT net> <5kpvk1$mc7 AT news DOT ox DOT ac DOT uk> <5kr5sf$b47$1 AT news3 DOT microserve DOT net> NNTP-Posting-Host: fac-g18-02.eng.monash.edu.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk okapi AT ezonline DOT com (Matt Gulden) wrote: >mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) wrote: > >>Matt Gulden (okapi AT ezonline DOT com) wrote: >>: Hello, I am very new to DJGPP (downloaded it the other day) and I'm >>: new to C/C++ but that isn't part of my problem... I noticed that when >>: I compiled a small program of about 10 lines, the EXE file size was >>: about 100k... all the program did was include iostream.h, and print >>: "hello, earth" (nice break from Hello, World) >>: Is there any way I can lessen the file size? > >>1) Put `-s' on the linking line (removes debugging info). > >>2) Compile larger programs; EXE size is not proportional to source size. > >>You can use `strip ' on an existing executable, which has the >>same effect as (1). The point in (2) is that most of your program is >>one-off startup code and library code, which only needs linking in once. >>Adding more source lines won't make it link this stuff in again. Other >>than that, the only reason I can think why EXE size could matter to you is >>because of the disk space taken up; don't worry about the memory, because >>parts which aren't used much will spend most of the time on disk. > >Thanks for your help... the EXE size kinda mattered cause I wanted to >make small graphical demos and stuff... I guess I could just use Turbo >C++ or something so not having to use DPMI and stuff like that... But >I'll stop wasting bandwidth... thanks! >Matt Gulden -- thrillhaus AT ezonline DOT com >http://www.ezonline.com/okapi/ You could try the executable file compressor mlp105b.zip which is in the djgpp/v2misc directory on simtel mirrors. I heartily recommend it, as it give me around 50% compression and has been trouble free, simple to use and with negligable speed penalty. Chris Wise