You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <dlfcn.h>
|
|
|
|
typedef int (*ft)(int);
|
|
|
|
int main()
|
|
{
|
|
void* handle = dlopen("./libhelper.so", RTLD_LAZY);
|
|
void* sym = dlsym(handle, "helper");
|
|
|
|
ft f = (ft)sym;
|
|
|
|
f(10);
|
|
f(15);
|
|
return 0;
|
|
}
|