From: makulik AT tf16 DOT mch DOT sni DOT de (Makulik.Guenther T 27528 R 91-811 WS tx24 ) Newsgroups: comp.os.msdos.djgpp Subject: Re: template classes with DJGPP Date: 5 Aug 1997 12:28:15 GMT Organization: Siemens Nixdorf Inc. Lines: 31 Message-ID: <5s768v$n84$1@horus.mch.sni.de> References: <01bca10d$bb446600$0100a8c0 AT stefan DOT schimanski> NNTP-Posting-Host: tmntn.mch.sni.de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Stefan Schimanski (stefan DOT schimanski AT metronet DOT de) wrote: : Hi, : I've implemented the following template class, that simulates a dynamic : array. Although I've put the whole definition of the class in the header : file, the linker displays errors. The compiler works fine. The linker can't : find the constructor definition: : Error: contest.o: In function `global constructors keyed to C': : contest.cc(24) Error: undefined reference to : `CContainer::CContainer(int)' : There were some errors : I've removed the parameter of the constructor an tried again. But I got the : same error. I know that some parameter for gcc exist to control the way it : handles template. Would some of them help? May be, I didn't try for myself. The problem could be either that you omitted the #pragma interface directive, or that you have to declare you implementations as inline explicitely. Try to write the implementation code inside the class definition. BTW why are you defining a container class (if not for study purposes), use STL components. These will be much more reliable than your own implementations and provide a lot of standard container types. I've not got it on my hand now, but if you're interested I can mail you where to find good documentation on STL on request. The headers and implementations are already part of the DJGPP standard C++ environment. HTH Guenther