Mail Archives: djgpp/1998/09/17/09:53:13
On Wed, 16 Sep 1998, Rylan wrote:
> I recently noticed while using FSDB that, when debugging Allegro code (I
> just looked at one of my Allegro using programs) that there are functions
> and routines included in the final .EXE that I do not use AT ALL in the
> program - so I want to ask too if there is anyway to exclude these unused
> library functions, not just for Allegro but any library from the final
> resulting .EXE?
The linker cannot load part of an object module. So, if a single .o file
stored in a library defines several functions, it loads all of them, even
if your program only needs one of them. You cannot do anything to
prevent that.
However, the DJGPP library usually makes a point of putting every
function on its own module, unless they cannot be separated. A notable
exception is the conio functions (cprintf, cputs, gotoxy etc.): they are
all defined on a single module. But the conio functions are so
intertwined and call one another so many times, that you cannot easily
separate them anyway.
- Raw text -