From: ryot AT bigfoot DOT com (George Ryot) Newsgroups: comp.os.msdos.djgpp Subject: Re: More template problems (C++) Message-ID: <380b1a61.7181287@news.clara.net> References: <7tp5ti$sp0$2 AT vixen DOT cso DOT uiuc DOT edu> X-Newsreader: Forte Agent 1.5/32.452 X-No-Archive: yes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 48 Date: Sun, 17 Oct 1999 00:50:09 GMT NNTP-Posting-Host: 195.8.92.99 X-Complaints-To: abuse AT clara DOT net X-Trace: nnrp4.clara.net 940121409 195.8.92.99 (Sun, 17 Oct 1999 01:50:09 BST) NNTP-Posting-Date: Sun, 17 Oct 1999 01:50:09 BST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Al Combs" wrote: > Ok, I know I've been here before with template problems, and now I need > specific help again to understand how templates work in DJGPP (G++). Here is I already answered this, what was not clear from my previous post? For your example code there is nothing special about how g++ handles templates. Some other compilers can handle templates in the way you want but they do so in a non-standard way. G++ conforms to ANSI/ISO standard (mostly) so will not compile your code. > 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. You need *TWO* files only: foo.h & main.cpp // foo.h template class Foo { public: void Replace(); }; // ALSO IN foo.h <----- *** THIS IS WHAT YOU ARE MISSING *** template void Foo::Replace() {} // main.cpp #include "foo.h" int main() { Foo hi; hi.Replace(); } And compile with: gpp -Wall -W main.cpp -o main -- george