From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with Templates Date: Sat, 15 May 1999 20:25:07 -0400 Organization: BrunNet Lines: 29 Message-ID: <373E1063.4727CBED@unb.ca> References: <373D6221 DOT 405F04B5 AT geocities DOT com> <373DEA8B DOT AEF818E9 AT enter DOT net> NNTP-Posting-Host: ftnts1c20.brunnet.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Sean wrote: > > However, it works perfectly if I get rid of testdef.cpp and put the > > definition of testmethod in header.h or at the top of main.cpp, so it > > doesn't look like it's anything to do with my code, but rather something > > to do with the linker. Does anybody know if this is the case, and if so, > > what should be done? > > > > Thanks in advance, > > Andrew Geers > > All templates are like that. Generally, I think, it's preferred to > #include the cpp file at the end of the header file, but the cpp file > needs to be #include'd somewhere, not just in the project file. Well, > maybe there's a compiler unlike that, but that's ANSI C++. To get around that would require some sort of linker-based compiler to make the code for the templates. I think the MSVC++ 5/6 does that. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT HotMail DOT com ICQ: 32959047