This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: using templates in shared library
- To: mrs at wrs dot com (Mike Stump)
- Subject: Re: using templates in shared library
- From: Kasper Peeters <K dot Peeters at damtp dot cam dot ac dot uk>
- Date: Wed, 9 Dec 1998 19:27:39 +0000 (GMT)
- Cc: oliva at dcc dot unicamp dot br, egcs at egcs dot cygnus dot com
- References: <199812091821.KAA03950@kankakee.wrs.com>
> -frepo. You do a full link with the two on the command line, and let
> it error out. But as a side effect, it will instantiate everything
> just once.
Unless I misunderstood your procedure, this also doesn't work. Let me
state my problem again: I am building _two_ shared libraries and _no_
executables. Library 1 uses vector<int> and so does library 2. When I
build library 1, the default egcs options will result in vector<int>
being instantiated in library 1. Good. Then I build library 2 and
during the link phase, I tell it to link dynamically to library 1.
It should be trivial for the linker to figure out that library 1
already has vector<int>. I want it to drop the instantiation of
vector<int> from library 2.
The -frepo only seems to work if I have an executable too. I could
make a trivial demo that uses everything in library 1 and 2, but that
makes the compiler recompile the demo, not the library.
Kasper