Instantiating templates in a shared library

Mike Stump mrs@wrs.com
Tue Mar 16 13:49:00 GMT 1999


> Date: Tue, 16 Mar 1999 18:19:52 +0100
> From: Jon Brumfitt <jbrumfit@estsa2.estec.esa.nl>

> The template instantiation approach, used in egcs-1.1.1, appears
> to work well. However, I have a problem trying to use templates
> within a shared library - the templates get instantiated in each
> executable that uses the library, which rather defeats my purpose
> in using a shared library.

You can have the users use -frepo or use an omf like ELF and GNU
binutils with linkonce support.  If you use linkonce, the stuff will
come out in .o files, but it should not be used (the content should
not make it into the a.out).  (If I understand linkonce and shared
libs.)

You didn't give enough detail for me to guess what the problem was
that you saw, or even if you saw one.  Please be sure to include all
relevant information in your requests.


More information about the Gcc mailing list