It is currently Sat, 04 Feb 2023 13:15:08 GMT

Author Message
 global variable with shared library
We are trying to use a shared object (that is also our code) that has a
global variable (full class)
when using this shared object we never get to that class constructor and the
class doesn't really exist.

for example
(this is a global code in the SO file)
DemoClass A;

(in the main code that was liked to the SO file)
A.what_ever = 100;
cause's Segmentation

we are looking for maybe a switch in the ld that created the SO or the main
that will tell him to use global vars in SO  (this how it works on DEC for

Changing this library to static makes it work with no problems.

 Sun, 03 Mar 2002 03:00:00 GMT   
 global variable with shared library
CC -Kpic -G make it works.

 Sun, 10 Mar 2002 03:00:00 GMT   
 global variable with shared library
Changing from ld to CC and use -G -Kpic make it works.

 Sun, 17 Mar 2002 03:00:00 GMT   
   [ 3 post ] 

Similar Threads

1. Global variables inside shared library on Solaris

2. Visibility of global variables in shared libraries

3. global variable in shared library?

4. global variable in shared library.

5. Singleton global variable in a shared library

6. Shared libraries and global variables

7. Problems with shared libraries and external global variables

8. Global data sharing in shared libraries

9. Shared variable between main() and loaded shared library - dlopen()

10. shared variables in shared libraries

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software