Error during Cross-compiling C code with Dynamic libraries
问题 I've two files: lib.c #include<stdio.h> void hi() { printf("Hi i'm a library function in lib.so\n"); } and main.c #include<stdio.h> #include<dlfcn.h> /* based on Jeff Scudder's code */ int main() { void *SharedObjectFile; void (*hi)(); // Load the shared libary; SharedObjectFile = dlopen("./lib.so", RTLD_LAZY); // Obtain the address of a function in the shared library. ciao = dlsym(SharedObjectFile, "hi"); // Use the dynamically loaded function. (*hi)(); dlclose(SharedObjectFile); } And I've