From: "John Bodfish" Newsgroups: comp.os.msdos.djgpp Subject: Re: Template problem. Date: 4 Jun 1997 16:17:17 GMT Organization: Ameritech Library Services Lines: 27 Message-ID: <01bc7102$7d3aa580$dfcde7c0@JOHNB.als.ameritech.com> References: <5n1cn4$ns3 AT lion DOT cs DOT latrobe DOT edu DOT au> NNTP-Posting-Host: n5223.als.ameritech.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gregary J Boyles wrote in article <5n1cn4$ns3 AT lion DOT cs DOT latrobe DOT edu DOT au>... > What am I doing wrong with this friggin template class.? > gxx -fno-implicit-templates test.cc > test.o: In function `main': > test.cc:15: undefined reference to `StackQueueC::StackQueueC(void)' > test.cc:30: undefined reference to `StackQueueC::~StackQueueC(void)' > > void main() > { > StackQueueC S; > } (template definitions omitted) Insert the following two lines prior to your first use of the StackQueueC template in main (e.g., before the "void main()" line): template class StackQueueC; template class NodeC; This instantiates the templates for the "int" datatype. See the node "Template Instantiation" in gcc.info for the gory details. -- John Bodfish bodfish AT als DOT ameritech DOT com