Mail Archives: djgpp/1998/10/04/22:11:43
On 5 Oct 98 at 0:32, Malefactor wrote:
> I know this sort of question is asked alot, and I have read the FAQ.
> But the file sizes mentioned in the FAQ are small compared to what I'm
> getting.
>
> Using Allegro, most of my programs range between 700 and 900k.
> I recently wrote a simple tile mapping program, the source only
> 5,162 in size, and it compiled to 4,271,616 bytes, with the -s option.
> I've included allegro.h and math.h, and the code is fairly optimized.
>
> DJP drops it to less then 200k. What I'm wondering is, should the
> EXE be that big (before DJP)? I know DJGPP makes large executables,
> but is there a threshold?
Are you writing C++ programs with large static arrays? If you
do this then IIRC the whole array will be included in the
executable, even if you don't initialise it. Try allocating
uninitialised arrays dynamically instead, and see if it helps.
The other solution which you already discovered is to compress
with DJP, which should remove all the dead space.
If you're using C then I don't think this matters.
The overhead of Allegro cannot be larger than the Allegro
library itself, which certainly isn't 4Mb! However, if you
are interested in reducing Allegro's overhead please see its
documentation, near the end of `allegro.txt': "Reducing your
executable size".
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -