|
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
|
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. -- |
the_y_man
Member #1,770
December 2001
|
switch to a windows compiler (i.e Dev-cpp with mingw). The file sizes are amazingly small! |
David Grace
Member #42
April 2000
|
...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
|
The good thing is that you tell the user to download the DLLs once, and then never more (except upgrading Allegro, of course). -- |
Marcello
Member #1,860
January 2002
|
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 |
|