Mail Archives: djgpp/1997/10/27/04:27:28
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 <cringe> 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.
- Raw text -