From: pneyz Newsgroups: comp.os.msdos.djgpp Subject: Re: Size of executables... Date: Sat, 28 Feb 1998 10:01:44 -0800 Organization: Smoof Team Lines: 25 Message-ID: <34F85108.E5619161@bethany.edu> References: <6d9c67$3or3 AT beaker DOT nit DOT gwu DOT edu> NNTP-Posting-Host: scz-ca16-06.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > about 200 Kb. Now I have copied to another directory the file ex1.c and I > have compiled with the lines > > gcc -c ex1.c > gcc -o ex1.exe ex1.o -lalleg > > and I have obtained an executable of 370 Kb. Now what I'm doinf wrong? Is > there any flag to use with gcc to avoid this? The program "hello world" is > of about 80 Kb. Is it not too much? Does anyone have an idea? To reduce the size of DJGPP programs, compile with the '-s' switch. This will remove debugging information. You can also compress them with DJP (I heard there was another (better?) DJGPP compressor out there. Is this true?), which is similar to PkLite, LZEXE, etc. I moved ex21.c and running.h into a temp dir and compiled with 'gcc ex21.c -o ex21.exe -s -Wall -lalleg' and got an executable of 173,056 bytes. Using DJP on it reduced it to 92,076 bytes. Quite an improvement, huh? -- /* pneyz / Smoof Team pneyz AT bethany DOT edu "Fine Malt Coding" http://ns.bethany.edu/pneyz/ */