www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/27/20:09:48

Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: "George Foot" <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Ron Penton <rpenton AT prodigy DOT net>
Date: Thu, 27 Aug 1998 21:01:37 +0000
MIME-Version: 1.0
Subject: Re: Am I retarded -or- Why is my exe size so big?!?
Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk
CC: djgpp AT delorie DOT com
Message-Id: <E0zC8GI-0007Pv-00@sable.ox.ac.uk>

On 27 Aug 98 at 12:06, Ron Penton wrote:

> I'm using djgpp 2.whatever and allegro 3.0. I know that allegro has a large
> overhead, but that overhead was supposed to be the same no matter how big
> the the program got. I've been programming a game for a few months and all I
> have is the interface and redraw functions, yet my exe size is 4.6 MEGS!!
> Yikes!!! I tried undeclaring allegro stuff, but nothing happened. The only
> gcc flag I'm using is -g. Can anyone help me please?

The `-g' flag tells gcc to add a lot of debugging information to your 
executable.  Run "strip myfile.exe" to remove this information before 
distributing your programs.  Also check that you're not defining 
large initialised static arrays, or even uninitialised ones in C++ I 
think; these will be embedded in the executable.

Allegro's overhead cannot exceed the size of the library file 
"liballeg.a" plus the size of the library file "libc.a" -- and to 
have all this overhead you would have to be using part of every 
feature in both Allegro and the C library.  On my system this is 
1,577,372 bytes.  That leaves at least 3Mb of your executable 
occupied by code, data and debugging information.  Personally I 
expect the debugging information will account for a sizable chunk of 
this space, and unless you have a lot of code there must be some 
pretty hefty data in there too.

Why don't you compile your source files to .o files and look at the 
sizes of those?  If you see any excessively large ones, have a look 
at their source code and try to figure out what's bloating them so 
much.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


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