From: "Dennis Janssen" Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,gnu.g++.help Subject: templates Date: 13 May 1997 17:49:31 GMT Organization: World Online Lines: 58 Message-ID: <01bc5fc6$6d16b7e0$0b88099a@dennis.worldonline.nl> NNTP-Posting-Host: brd1-p11.worldonline.nl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, I'm new to C++ and now I'm trying to learn how to use templates. I've written the following three files. [CSTACK.H] #ifndef CSTACK_H #define CSTACK_H template class cStack { public: cStack(); int push(stackType element); }; #endif CSTACK_H [CSTACK.CC] #include #include "cstack.h" template cStack::cStack() { cout << "Constructed" << endl; }; template int cStack::push(stackType element) { cout << "Pushing..." << endl; return 0; }; [TESTSTCK.CC] #include "cstack.h" int main () { cStack int_stack; int_stack.push(12); return 0; } When I try to compile it using DJGPP 2.01 (based on gcc 2.7.0.1) I think I get the following two errors: undefined reference to cStack::cStack(void) undefined reference to cStack::push(int) How do I fix this? I've read something in info about GCC neither supporting the Borland model nor the C/C++ frontend (or something) but I don't understand how to fix it. Dennis!