From: "Al Combs" Newsgroups: comp.os.msdos.djgpp Subject: Re: More template problems (C++) Date: Mon, 11 Oct 1999 06:53:58 -0500 Organization: University of Illinois at Urbana-Champaign Lines: 53 Message-ID: <7tsise$aa$1@vixen.cso.uiuc.edu> References: <19991011052444 DOT 76643 DOT qmail AT hotmail DOT com> NNTP-Posting-Host: spider.cso.uiuc.edu X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3 X-Proxy-Client: acombs AT uiuc DOT edu from PPPa43-ResaleChampaign1-4R1141.saturn.bbn.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Nope... didn't quite work. Even adding that, I still get the error: main.C: undefined reference to `Foo::Replace(void)' when the .exe compliles. Thanks for your help thoguh. sundaresh venugopal wrote in message <19991011052444 DOT 76643 DOT qmail AT hotmail DOT com>... >The scope qualifier for Replace() is missing.Try this slightly modified >code, and see if it works. > > >Here is >>my code: >> >>*** foo.h >>template >>class Foo >>{ >>public: >> void Replace(); >>}; >> >> >>***foo.C >>#include "foo.h" >> >template void Foo::Replace() >{} >> >>***main.C >>#include "foo.h" >> >>main() >>{ >> Foo hi; >> hi.Replace(); >>} >> >> >>And I get the error on the compilation of the executable: >>:main.C: undefined reference to `Foo::Replace(void)' >> >>Now, my question is what SPECIFICALLY would I need to change to make gpp >>compile it properly? In otherwords, how would I have to re-write the code >>to >>make it work? Please be as speciffic as possible. >> >>Thanks again, >>Al Combs > >______________________________________________________ >Get Your Private, Free Email at http://www.hotmail.com