delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/27/04:27:28

Date: Mon, 27 Oct 1997 11:23:35 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Brett Porter <bporter AT rabble DOT uow DOT edu DOT au>
cc: DJGPP <djgpp AT delorie DOT com>
Subject: Re: DJGPP linker: a definitive answer wanted
In-Reply-To: <199710270603.RAA16492@rabble.uow.edu.au>
Message-ID: <Pine.SUN.3.91.971027112316.19645I-100000@is>
MIME-Version: 1.0

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 -


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