#include #include int main(int argc, char **argv) { void *handle; int (*square)(int); const char *error; handle = dlopen ("C:/Documents and Settings/gordonp/My Documents/NetBeansProjects/DlopenTest_1/shared/dist/Debug/Cygwin-Windows/libshared.dll", RTLD_LAZY); if (!handle) { fputs (dlerror(), stderr); exit(1); } square = dlsym(handle, "square"); if ((error = dlerror()) != NULL) { fputs(error, stderr); exit(1); } printf ("%d\n", (*square)(1)); printf ("%d\n", (*square)(2)); printf ("%d\n", (*square)(3)); dlclose(handle); }