I have some source files that I compile and link together to make a shared
library (called sharedLib.so). They share a global variable called, for
example, GlobalVar which is defined in one of the source files (called
sharedMain.c). I then have another set of source files that I compile and
link against this shared library to make an executable (myExec). They too
use a variable called GlobalVar which is defined in one of the source files
(called realMain.c). I'd like to link myExec link against sharedLib.so but
have it use the GlobalVar defined in sharedMain.c not share the one in the
library. So what I'm after is the way to stop the GlobalVar being exported
in sharedLib.so. How do I do this? In Solaris I'd used the -B option (I
think).


Reply via email to