www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/15/10:03:29

Xref: news2.mv.net comp.os.msdos.djgpp:8639
From: gt4558a AT acmey DOT gatech DOT edu (Rubicant)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: large .exe files
Date: 8 Sep 1996 06:58:31 GMT
Organization: Georgia Institute of Technology
Lines: 47
Message-ID: <50tqqn$t23@catapult.gatech.edu>
References: <32307DB9 DOT 714D AT postoffice DOT newnham DOT utas DOT edu DOT au>
NNTP-Posting-Host: acmey-prism.gatech.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ryan Boyes (rboyes AT postoffice DOT newnham DOT utas DOT edu DOT au) wrote:
: Hi again,

: When I compile/link c++ source in djgpp (usually from rhide) I end up
: with these big .exe files that leave the size of the source file for
: dead. I always thought it was supposed to be the other way around! I
: have a feeling the compiler is including a heap of libraries that aren't
: really needed. Any ideas, anyone?

: Thanks in advance,

: Ryan

Yeah, there are three solutions I can think of off the top of my head:

1) Download all of the source code for all of the libraries and recompile
them all yourself, omitting all of the functions that aren't used by your
program.  NOT RECOMMENDED :)

2) Make your program big enough that the additional libraries don't SEEM
to take up much space.  By this point, your code should also surpass your
exe.  Of course, by this point you should also have a nice, big, hopefully
useful program that could make you some money too :)  Then again, maybe not.

3) Rationalize by thinking about how low the prices for big hard drives
are these days.  This one actually works pretty well.


Ok, ok, I realize that these aren't very useful suggestions.  One
possiblity, if you are willing to spend some extra time and are making
lots of little programs, is to compile them all into the same executable,
using a commandline switch to determine which actual program you want to
run.  That way, you only need on set of library functions for however many
programs you have.  This comes with two drawback, though.  First, you have
to remember the commandline switches (although an in-program helpfile
could make that not too bad).  Second, the linking times of your
mega-program would start to get painful at some point.  Of course, this
isn't exactly elegant, but it should work fine.

If someone has a better suggestion that would actually involve removing
unused functions, I'd be interested as well.

Oh, btw, don't forget to use strip.exe.  It will knock off a fair amount
of space right off the bat.

--
						-- Rubicant --

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019