Date: Mon, 27 Oct 1997 11:23:35 +0200 (IST) From: Eli Zaretskii To: Brett Porter cc: DJGPP Subject: Re: DJGPP linker: a definitive answer wanted In-Reply-To: <199710270603.RAA16492@rabble.uow.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 27 Oct 1997, Brett Porter wrote: > Now, will _all_ of the functions be linked into _both_ of the programs, or > only the ones used? It depends on how did you divide these functions between source files. Every source file gets compiled into a single object file. When that object file is linked into a program, all the external objects (functions and global variables) defined in that object file are linked in. > If they all are, is there a way of making sure only the > used ones are linked (eg conditional defines, or only good > programming design) Divide your classes into source files in a way that separates between classes which are required by only one of the programs. That is good programming design. But generally, there's nothing wrong in C++ world with having only part of the class functionality used. How much of the code is left unused, anyway? You might be haunted by the shadow of a dwarf, you know.