Getting undefined symbol error while dynamic loading of shared library
问题 I am getting undefined symbol error while loading library dynamically. Here is my code snippet that generates this error : int main () { void *lib_handle = NULL; MyClass* (*create)(); void (*destroy)(MyClass*); char *error; lib_handle = dlopen ("./libshared.so", RTLD_LAZY); if (lib_handle == NULL) { fprintf(stderr, "%s\n", dlerror()); exit(1); } create = (MyClass* (*)()) dlsym(lib_handle, "create_object"); if ((error = dlerror()) != NULL) { fprintf(stderr, "%s\n", error); exit(1); } destroy =