I am trying to use dlopen() and dlsym() in my code and compile it with gcc.
dlopen()
dlsym()
gcc
Here is the first file.
/* main.c
you can use union, like this:
union
union { void *ptr; void (*init_google_logging) (char* argv0); } orig_func; orig_func.ptr = dlsym (RTLD_NEXT, "_ZN6google17InitGoogleLoggingEPKc"); orig_func.init_google_logging (argv0);