This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Templated functions in libraries


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]