"Spaceman" <[EMAIL PROTECTED]> writes:

> If I compile this to generate the shared library and executable using
> the -fPIC option I get the following output:
>
> My Value= 10;
> My Value= 99;
> My Value= 99;

That's correct output ...

> However, The output I would expect is:
> My Value= 10;
> My Value= 99;
> My Value= 10;

Your expectations are incorrect (probably influenced by your
experience with Win32 DLL model, which is very different from all
other UNIXes (except AIX)).

> Can anyone please help with this?

You need to specify platform (I'll assume Linux/x86_64).

You can get behaviour similar to Win32 by linking the shared library
with -Bsymbolic linker flag (prefix it with -Wl, when using 'gcc'
or 'g++'), or by localizing CommonElement::m_static with a linker
version script (info ld -> Scripts -> VERSION).

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to