Xref: news-dnh.mv.net comp.os.msdos.djgpp:2919 Path: news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!EU.net!news.eunet.fi!KremlSun!newshost.elvis.ru!news.uni-stuttgart.de!uni-regensburg.de!lrz-muenchen.de!informatik.tu-muenchen.de!news From: Peter Breitling Newsgroups: comp.os.msdos.djgpp Subject: Re: Templates in DJGPP. Date: 27 Oct 1995 15:04:18 GMT Organization: Technische Universitaet Muenchen, Germany Lines: 24 Distribution: world References: <1995Oct27 DOT 092027 AT zipi DOT fi DOT upm DOT es> Nntp-Posting-Host: hphalle10i.informatik.tu-muenchen.de To: a920101 AT zipi DOT fi DOT upm DOT es Dj-Gateway: from newsgroup comp.os.msdos.djgpp >I've made a generic list in C++ using templates, and tested it under BC++ 3.1. >It works fine. Then, i ported it to DJGPP. It compiles fine, but when I use it >in a test program, when linking, it complains about non-existing functions when >it finds a call to one of my list's method. I have faced that problems many times as well. If you use inline methods, then you have to write them in the header file (of course) AND (if implemented not directly in the class def) it is good to declare them RIGHT behind the class definition - not anywhere else. This seems to be a bug of gcc. Also some func in an object don't seem to be linked if related header files are NOT DIRECTLY included (#include) from the code that uses these functions Thus play a bit with header files, postition of inline methods (in .h file if any) and (perhaps) the order of linking the objects / libs. Hope this helps! -- __ __ /__) \_)reitling * breitlip AT informatik DOT tu-muenchen DOT de / ( ( eter )__) * http://www.informatik.tu-muenchen.de/~breitlip/ (_Oo\_