Mail Archives: djgpp/1997/05/29/15:31:45
Claude Sassine wrote:
>
> I compiled a 699-byte file and got a 140KB executable. This led to look
> at the FAQ files. The FAQ mentions two possible remedies for the size
> problem. The -s switch brought the executable's size down to 68KB. The
> other option stated: etc. etc. etc...
this same post appears SO many times, maybe the faq should just say:
DJGPP is a 32 bit compiler that makes really fast running executables!
unfortunately, this entails some overhead in terms of file size. (the
memory image of a given program will be QUITE SMALL for a 32-bit app,
compared, say, to a DOS4GW exec.)
if you feel you must have a smaller than usual file, compile with the -s
option and then run the DJP file compressor. this will make the file
smaller. (your 68kb file would then be about 40k).
if you simply want the smallest executable from a C program, try using
MicroC, a shareware compiler, which I used recently to make:
#include <stdio.h>
void main(void){outw(0x310, 32767)}
which sends a zero voltage to my 50 ton press :-)
which compiled to a 400 byte com file. but i think its only a 10 byte
exe if you do it in assembler!
but if you want to make really nice programs with graphics and monstrous
arrays and shell-out and drop PCX files and stuff, you won't worry about
the exe size, because DJGPP & Allegro do this better than anything!
phil
- Raw text -