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]
Other format: [Raw text]

dlopen and template instantiation


hi there,

I'v a problem with duplicate template instantiation in code
using dlopen...

I'm using a 'singleton' template to access a global object.
The singleton is accessed from within a library libfoo.so,
as well as from within a python module bar.so (written with
boost::python), which is linked to libfoo.so.

When I run a python script that uses the 'bar' module, I see
that two distinct instances of the singleton are accessed.

How does gcc deal with this case ? Shouldn't static template members
be defined as weak symbols such that only one instance is used ?

Is there anything I have to do to make template instantiation work
with dlopen ?

I'm using RH 9 with gcc 3.2...

Thanks a lot,
		Stefan


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