gburson
asked on
Accessing global vars in an exe
I have an application on AIX that dynamically loads libraries at run-time (the executable is not linked to the libraries). Is it possible to access a global variable inside the executable, from the loaded library ? I tried declaring the global, then using "extern long glName;", and it compiles. But when I try to access it, my app crashes. P.S. my 'C' is quite rusty.
Thankyou,
Glen.
Thankyou,
Glen.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How do you export functions in a DLL under AIX?
You should be able to do the same with a global variable.
You should be able to do the same with a global variable.
ASKER
I had the same problem originally with the global (it wasn't exported). I referenced it in some of the code, and then it was exported. Not true with the function. I have called it in the code, explicitly named it in an export file, used the linker option to export all symbols, and its still not there !
I must be missing something ...
Ta,
Glen.
I must be missing something ...
Ta,
Glen.
ASKER
long * getAppInfo(void);
but when I check the exported functions, its not there (I check using 'nm' as I am running on AIX).
Thanks again,
Glen.