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
This is a discussion on DJGPP still produces bulky exes! within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Even after I use the -s switch in compiling my C++ code in DOS, a 2,500 byte .cpp file turns ...
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
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/
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