PDA

View Full Version : DJGPP still produces bulky exes!



ustuzou
02-18-2002, 11:16 AM
Even after I use the -s switch in compiling my C++ code in
DOS, a 2,500 byte .cpp file turns into a 250,000 byte
.exe. Any tips on reducing the size of the .exe beyond
what Mr. Delorie suggests in his documentation?

Miki
ustuzou@sympatico.ca

Salem
02-18-2002, 02:11 PM
Well if the author doesn't know, there's not much you can do

Though it has to be said that C++ has a greater overhead than C (in the amount of run-time support).

That is one of your tradeoffs - you trade nice OO code development against larger base executable sizes.

If you were going for the smallest possible executable, you should have chosen assembler.

You could pack it, using say
http://upx.sourceforge.net/

ustuzou
02-18-2002, 02:44 PM
Thanks. The program compressed my 246,000-byte .exe to a
90,000-byte .exe, and the program still works perfectly.
Unfortunately, it will probably work only on a 32-bit
system, since that is what the compressor is for.

I'll still have another look at Delorie's other
suggestions and study up on DJGPP to see what all the
command line switches are.

Miki
ustuzou@sympatico.ca