This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Templated functions in libraries
- To: "M.W. van der Molen" <Matthijs dot M dot W dot vanderMolen at siep dot shell dot com>
- Subject: Re: Templated functions in libraries
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 15 Jul 1999 06:33:51 -0300
- Cc: martin at mira dot isdn dot cs dot tu-berlin dot de, egcs at egcs dot cygnus dot com, E dot BOUTS at siep dot shell dot com, G dot D dot RENZELMAN at ssi-epic dot shell dot com
- References: <199907142244.AAA00745@mira.isdn.cs.tu-berlin.de> <378DA44A.143D57AE@siep.shell.com>
On Jul 15, 1999, "M.W. van der Molen" <Matthijs.M.W.vanderMolen@siep.shell.com> wrote:
> Do I need compile options to make g++ generate instantiations at
> some point when makeing or linking the library ?
You'd have to know beforehand which instantiations you're going to
need, otherwise there's no way for the library to supply all those
instantiations.
The simple solution is to arrange that the template *definition* (not
just the declaration) is available in the header file included by
programs that need the instantiations.
The best solution, in your case, would be to `export' the template
definition, but this isn't currently supported, and I don't know how
it would be possible to support it in this case, in which the template
is only defined in an object file that was linked into a shared
library.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them