In a program I am writing, I need to use a shared library. The basic
implementation of the library assumes that the library runs in the same
task (or thread, whatever) as the calling application. It uses the
'static' keyword to ensure that certain variables are the same
throughout every app using the library (otherwise I believe, a separate
copy of the data is made for each caller). I *believe* this is the case
- I know it is in windoze, but how about in linux shared libraries?
Another problem is that I also try and make X window calls inside the
library (don't ask) - ie: call XOpenDisplay and all that jazz. Problem
is that I get a segfault at XOpenDisplay (memory allocation problem). Is
there some kind of limitation inherent in libraries that would prevent
doing this? Or is it peculiar to X11? Or am I doing something wrong?