/* Based off the example in "man dlopen". */ #include #include #include int main(int argc, char **argv) { void *handle; /* If "libpcre.so.0" is used, then this works. */ handle = dlopen("libpcre.so", RTLD_LAZY); if (!handle) { fprintf(stderr, "%s\n", dlerror()); exit(EXIT_FAILURE); } printf("Must have linked properly...\n"); dlclose(handle); exit(EXIT_SUCCESS); }