I am writing an application in C which used a global variable (a logfile structure). In my application I am loading shared libraries dynamically at runtime and I want to use
You need to compile your main application with -rdynamic flag (eg: gcc -g -rdynamic -o main main.c, and to declare the global variable in your dynamic library with extern.