Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Why are *.C to *.EXE files greater than 500k in size?

This thread is locked; no one can reply to it. rss feed Print
Why are *.C to *.EXE files greater than 500k in size?
James Osborne
Member #2,746
September 2002

Ok, everything works great, and functions great, but when I used GCC to compile a C example to EXE example, the EXE files are at least 500k!! In realmode DOS, you rarely see programs exceed 300k in size? What is up with that? Also, if I used the DEBUGMODE=1 in my MAKE, is there a way to go from debugging to optimization? I would assume DEBUGMODE=0 would fix that.

Anyways, as much as I'm thrilled to have DJGPP and Allegro, I just can't believe the file output size is that huge!!

(Recently, I've been wanting to go from QBasic/Assembly to C/Allegro)

Bob
Free Market Evangelist
September 2000
avatar

DJGPP programs need to bundle all sorts of pmode drivers for the things that are typically done via the BIOS in rmode. THings like memory management, disk access, console access, hardware access, etc. In essence, DJGPP embeds a mini-OS inside your executable!

Not only that, but Allegro is a pretty large library too, so a lot of code gets linked in.

This is why your executables are so large.

You can compile with -s (small s) to strip debug symbols. You can also compress your executables with UPX. This will help reduce their size.

--
- Bob
[ -- All my signature links are 404 -- ]

the_y_man
Member #1,770
December 2001
avatar

switch to a windows compiler (i.e Dev-cpp with mingw). The file sizes are amazingly small!

David Grace
Member #42
April 2000
avatar

...but then you have to include about 400k of DLLs along with your EXE to make it work -- so you're right back to where you started. :)

UPX is your friend.

ReyBrujo
Moderator
January 2001
avatar

The good thing is that you tell the user to download the DLLs once, and then never more (except upgrading Allegro, of course).

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Marcello
Member #1,860
January 2002
avatar

Of course if you only make full games, the lib overhead on the exe is trivial, isn't it? :)

I prefer not using the dll since it's kinda confusing... Unless I'm making an exe for people who use allegro...

Marcello

Go to: