Hi all,
I want to make a shared library which has a global variable.
This library is linked to two processes.
One main() function increments the global variable value
other main() function has to read the
incremented value.
How can I do this on gcc 4.0 , i-mac with OSX as 10.4.6. ?
When i make a shared library or dynamic library the global
variables are placed in local block of library, not
In the shared block of library.
Is their any way of coding to place my global variable in
shared block of library?
I have tried int nGlobalVariable _attrribute__((common)) = 2;
But this does not work. As every new executable has initial
value, not the value set by one of the process.
Please help on this.
Thanks and Regards
Kumar
Gaurav