[linux-audio-dev] Static class data and dlopen()

Alfons Adriaensen fons.adriaensen at alcatel.be
Mon May 19 08:34:00 UTC 2003

This is not strictly a Linux Audio question, but I encountered
this matter in the context of writing LADSPA plugins, so...

Imagine you have a C++ class S which has some static data.
Derive A from S and use A to create a plugin a.so
Derive B from S and use B to create a plugin b.so

When a host links (at runtime) with both a.so and b.so,
then the static data from S will be created twice (I verified
this to be the case).

This is what I expected, but it may shock C++ purists, so my
question now is this:

Is this the 'official' behaviour when loading plugins, or is this
something that could change with future version of g++ and the DL libs ?


More information about the Linux-audio-dev mailing list