with seeing the code i cant do much but heres a simple example
dlload.c
Code:
#include <dlfcn.h>
int main(int argc, char **argv)
{
void *lib;
void (*fn)();
if(argc != 2) return -1;
lib=dlopen(argv[1], RTLD_LAZY);
fn=dlsym(lib, "hello");
fn();
dlclose(lib);
return 0;
}
hello.c
Code:
#include <stdio.h>
void hello()
{
printf("Hello\n");
}
[kev82@tifa:kev82](1050)$ gcc -o dlload dlload.c -ldl
[kev82@tifa:kev82](1051)$ gcc -shared -fPIC -o hello.so hello.c
[kev82@tifa:kev82](1052)$ ./dlload ./hello.so
Hello
[kev82@tifa:kev82](1053)$