//-Wl,--export-dynamic #include //NULL /// dlfcn.h /// #ifdef __cplusplus extern "C"{ #endif #if defined(WIN32) || (!defined(__GNUC__) && !defined(__clang__)) void* LoadLibraryA(const char *x); void* GetProcAddress(void *x,const char *y); int FreeLibrary(void *x); #elif defined(__APPLE__) void* dlopen(const char *x,int y); void* dlsym(void *x,const char *y); int dlclose(void *x); #define LoadLibraryA(s) dlopen(s,2) #define GetProcAddress dlsym #define FreeLibrary dlclose #else void* __libc_dlopen_mode(const char *x,int y); void* __libc_dlsym(void *x,const char *y); int __libc_dlclose(void *x); #define LoadLibraryA(s) __libc_dlopen_mode(s,2) #define GetProcAddress __libc_dlsym #define FreeLibrary __libc_dlclose #endif #ifdef __cplusplus } #endif typedef void (*Tvoid)(); Tvoid pcatch; int main(){ void *h=LoadLibraryA(NULL); pcatch=(Tvoid)GetProcAddress(h,"catch"); pcatch(); }