From: Ian Miller Newsgroups: comp.os.msdos.djgpp Subject: Re: Odp: Library with templates - help !!!!!!!!!!!!! Date: Sat, 20 Jan 2001 16:28:33 -0000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: Sender: itm AT shelob References: <94c3au$791$1 AT info DOT cyf-kr DOT edu DOT pl> <94cba9$5a0$1 AT info DOT cyf-kr DOT edu DOT pl> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.91 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse AT supernews DOT com Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Rafal Maj" writes: > Yes, > but when definiton (in real program - very long) of my class is in box.h, > then it is re-compiled every time, with can take very much time. What Jason Green showed you is the normal way of writing template classes and their functions... > I want to > have definition in other .cc file to re-compile it only when necessary, in > bug.h I want only definition of my class. ...and this isn't. (I believe you mean "declaration" by the way.) > When I write definition of normal class in my library *.cc file - OK > When I write definition of template class in my main *.cc file - OK > When I write definition of template class in my library *.cc file - error ! That's just the way template classes work, I'm afraid. (So far as I know anyway.) Some compilers can "compile the headers" on order to answer your objection to writing the code correctly, but I don't think gcc does so yet. Regards, Ian