Boost logo

Boost :

From: martin.ecker_at_[hidden]
Date: 2004-09-07 07:04:57

Neal Becker wrote:
> Is this perhaps a MS-windows specific problem? I did build a shared lib
> (using scons, I haven't learned jam yet), and AFAICT it is working, on
> Linux.

I'm pretty sure you will also run into problems with shared objects
under Linux. The problem is that certain global variables (e.g. for
the type registry) are defined as static member variables in header
files. Under Windows, if two different DLLs include this header file,
you will get two different copies of that static member variable - one
in each DLL - although there should only be one. Maybe the linker
under Linux is smart enough to resolve such issues.

Have you tried to serialize a class defined in one shared object
(which is registered in the type registry via BOOST_CLASS_EXPORT) from
code in another shared object? That's when you might run into
problems. You definitely will under Windows.

You might also run into problems when you dynamically (i.e. explicitly
in your code via dlopen) load a shared object, which contains classes
that use BOOST_CLASS_EXPORT to register themselves. Again, under
Windows you definitely will.


TAB Austria
Haiderstraße 40
4052 Ansfelden
Phone: +43 7229 78040-218
Fax: +43 7229 78040-209
E-mail: martin.ecker_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at