From: "Al Combs" Newsgroups: comp.os.msdos.djgpp Subject: Re: Templates? What templates? Date: Fri, 24 Sep 1999 22:04:28 -0500 Organization: University of Illinois at Urbana-Champaign Lines: 60 Message-ID: <7shdud$fnl$1@vixen.cso.uiuc.edu> References: <7sgp47$svt$1 AT vixen DOT cso DOT uiuc DOT edu> <37ed04ed DOT 4818379 AT news DOT clara DOT net> 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 PPPa30-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 Yes, I tried it in CC, and it works fine. G++ gives an error like: main.o(.text+0xe):main.C: undefined reference to `Array::Array(void)' And what do you mean "move the template definition?" I've tried commenting out template in the array.C file, and it still gave me the same error. Specifically what changes would you recommend? George Ryot wrote in message <37ed04ed DOT 4818379 AT news DOT clara DOT net>... > >> in my array.h file: >> >> template >> class Array >> { >> public: >> Array(void); >> >> private: >> Etype y; >> }; >> >> in array.C: >> >> #include "array.h" >> >> template >> Array::Array(void) >> { >> y = 0; >> } >> >> in main.C: >> >> #include "array.h" >> >> int main(void) >> { >> Array x; >> >> return 0; >> } > >Try moving the template definition from array.C to array.h > >Did you test this with CC? > >> >> When is g++ gonna support the standard? >> > >> >AFAIK, g++ supports the standard. Please post sample code that is >> >accepted by CC (on what platform, btw? CC doesn't tell anything about the >> >machine and the OS) but rejected by g++. >> > >> >Also, what version of g++ are you using? > >-- >george