Subj : Re: Simple template linking problem To : borland.public.cpp.borlandcpp From : Colin Date : Thu Sep 11 2003 09:53 am "Thomas Maeder [TeamB]" wrote: > > Colin writes: > > > Linker Error: Undefined symbol TList::Delete(int) in module > > listtest.cpp > > Linker Error: Undefined symbol TList::Add(TCommBuffer far*) > > in module listtest.cpp > > Linker Error: Undefined symbol TList::TList() > > in module listtest.cpp > > Linker Error: Undefined symbol TList::~TList() > > in module listtest.cpp > > > > and yet the test app uses First, Last and Count ? What's going on??? > > > > TIA (oh, and sorry about the verbosity, but I thought you'd like to see > > the whole code!!!!) > > Actually, *minimal* code is what we want to see. Just enough to see the > problem; usually, this is <50 lines. > > Where are these template member functions implemented? Directly in the header? > Or in a separate (.cpp) file? > > If the latter, that is the problem. Templates can't currently be separately > compiled, unless you use one of very few compilers that support it. No > Borland compiler is among these. Sadly, although I'd love to say "That's it!", the answer is that it made no difference putting the template method implementations into the header file, the linker still can't find the four methods shown.... Should I "flesh out" the class definition with the implementations, if so thats horrible, but if that's what it takes..... .