Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 1997 16:01:22 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        jmacd@CS.Berkeley.EDU (Josh MacDonald)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: g++, STL and -frepo on FreeBSD-2.2-Beta
Message-ID:  <199702042301.QAA13316@phaeton.artisoft.com>
In-Reply-To: <199702040559.VAA08584@paris.CS.Berkeley.EDU> from "Josh MacDonald" at Feb 3, 97 09:59:35 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > Clearly, the template class definition
> > 
> > 	template <class Type>
> > 	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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702042301.QAA13316>