From owner-freebsd-hackers Tue Feb 4 15:04:05 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA20383 for hackers-outgoing; Tue, 4 Feb 1997 15:04:05 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id PAA20349 for ; Tue, 4 Feb 1997 15:04:00 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id QAA13316; Tue, 4 Feb 1997 16:01:22 -0700 From: Terry Lambert Message-Id: <199702042301.QAA13316@phaeton.artisoft.com> Subject: Re: g++, STL and -frepo on FreeBSD-2.2-Beta To: jmacd@CS.Berkeley.EDU (Josh MacDonald) Date: Tue, 4 Feb 1997 16:01:22 -0700 (MST) Cc: hackers@FreeBSD.ORG In-Reply-To: <199702040559.VAA08584@paris.CS.Berkeley.EDU> from "Josh MacDonald" at Feb 3, 97 09:59:35 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Clearly, the template class definition > > > > template > > class list ... { > > ... > > }; > > > > is not in scope. The header files you have included are apparently > > not sufficient. > > > > Perhaps you meant "List" instead of "list"??? > > Clearly, you have no idea what you're talking about. You should be a > bit more careful with your use of "clearly", it makes me wonder how > much of the rest of your mail to this list (which I rarely understand) > is correct. If the linker can not resolve the symbol, the symbol: A) Is not in scope B) Is not there, period C) Was not created in scope because you want the linker to "magically" share template implementation between class specific template instantiations. If you want the linker to "magically" share template implementations by providing cast stub headers and passing around void pointers so you don't have to actually reimplemnt the code... Well, it's won't do it. This is a new thing, and the a.out linker is not being actively maintained. As people pointed out in other responses, you can download John Polstra's "ELFKit" and use it instead of the FreeBSD default a.out g++ compiler and linker, and it will then work. If you want it to work with the current code, you need to define the template class in scope before you use it so that the functions are actually statically instantiated in the module where they are declaratively referenced. This is because historically, the template implementations have not been shared betwen class types. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.