shared library binding only to library not to process
<p>i have the following problem with shared librarys</p>

<p>create a shared libraray</p>

<pre><code>class A
{
  static int callCount;
  A() { callCount++; }
}
int A:callCount = 0;
class Main
{
  Main()
  {
    A a1();
    A a2();
  }
}
</code></pre>

<p>now create an process which is loading this shared libraray more times and i would like have the callCount belongs only to the shared library not to the whole process</p>

<pre><code>dlopen("shared.so", RTLD_LAZY);
// after some code i can construct Main() 
// and now i will open the shared object again
dlopen("shared.so", RTLD_LAZY);
// now if i construct Main from the new library i want to have a new 
// initialized callCount eq 0 but its 2
</code></pre>

<p>how can i solve this problem</p>
