From: ryot AT bigfoot DOT com (George Ryot) Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP 2.95 Templates Message-ID: <37ecba3c.8727013@news.clara.net> References: <37E9501D DOT 3E95D5EA AT mail DOT retina DOT ar> 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: 36 Date: Thu, 23 Sep 1999 23:41:14 GMT NNTP-Posting-Host: 195.8.91.152 X-Complaints-To: abuse AT clara DOT net X-Trace: nnrp4.clara.net 938130074 195.8.91.152 (Fri, 24 Sep 1999 00:41:14 BST) NNTP-Posting-Date: Fri, 24 Sep 1999 00:41:14 BST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > I think that I have a problem related to template instantiation, > the following code : > > // FILE rwfile.h and rwfile.cpp > #include "smat.h" > > class rwfile > { > .. > template int read( smat data); > .. > } > compiles without problems, but the linker reports (I am using a RHIDE > 1.4.7 project): > > Error undefined reference to int rwfile::read( smat ) > > any ideas? Yes, you probably wanted to define read() in the header file rwfile.h template int rwfile::read(smat data) { // ... } Rather than in rwfile.cpp where I assume that you defined it. OTOH, if you have found a bug in gcc then it is better to reduce the program to the minimum that causes the error then cut and paste that verbatim, else it just leaves everybody guessing. :) -- george