Mail Archives: djgpp/1997/05/08/05:46:32
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 <exename>' 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
- Raw text -