TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JASON HENDRIKS
from: DIMITRI SMITS
date: 1997-03-10 16:43:00
subject: template problem / multiple source / wat16:43:0103/10/97

 > I am using Watcom 10.6 and I am having problems with
 > templates in multiple source files.
I am not sure as whether I am telling something that is gonna make sense, 
since I have not used Templates yet,
but it is my belief that a template class needs to be
'recompiled' every time ... so in your case, you have
compiled a .obj with the int 'class'
when you later want to compile something, it doesn't compile
node.cpp with the new template class, thus leaving it with
int's, or if you DO attempt to recompile it, the compiler
does not know what the class is you are compiling it with,
so it doesn't find the 'compiled' version of the
new class ... SO ...
It is my guess that you need to put the declaration
AND implementation in a .h/.hpp file when dealing with
template classes :-)
since for every new templated class, the entire code has to
be recompiled ...
 > Why is the template making this appear?  The problem
 > goes away if I move the member funcitons from NODE.CPP
 > to NODE.H, but shouldn't it be able to handle the
 > mulitple source files of the class with the template
 > as it does without?  Is there another solution?
I really don't know ... the above is about everything I
know about templates :-/
being just a student that had C++ last year and is finally
exploring the language ;-)
Greetz,
Da Gongo
--- FMail/386 1.02
---------------
* Origin: Only The Lonely ... (2:292/8013.12)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.