This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: using templates in shared library
On Dec 9, 1998, Kasper Peeters <K.Peeters@damtp.cam.ac.uk> wrote:
>> that's because the component object files contain those symbols
>> already. I don't think the linker should remove those symbols from
>> a shared library; can you think of the implications of replacing the
>> other library your library depended upon?
> Well, the first library is just required to contain the symbols
> associated to my templates. If a new version doesn't have them, it's
> not a new version but a broken version.
The linker coulnd't know that :-)
> But regardless of the philosophy, let me rephrase my question: how
> can I force the compiler NOT to instantiate symbols in an object
> file which are already present in a given shared library on my
> system?
You can always use -fno-implicit-templates or -frepo, together with
explicit template instantiation, to control where templates should
go.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil