Linux equivalent of DllMain
You can use the __attribute__((constructor)) and __attribute__((destructor)) to execute code on load and unload of the shared library.
You can use the __attribute__((constructor)) and __attribute__((destructor)) to execute code on load and unload of the shared library.
There are two ways of loading shared objects in C++ For either of these methods you would always need the header file for the object you want to use. The header will contain the definitions of the classes or objects you want to use in your code. Statically: #include “blah.h” int main() { ClassFromBlah a; … Read more
use nm -D –defined-only libname.so to get the symbol names from your dynamic library. The –defined-only switch shows you only the symbol that are defined in these files, and not references to external functions. An alternative is to use objdump, and catch only the symbols in the text section : objdump -T /usr/lib/libjpeg.so | grep … Read more