#include #include "dll.h" int main() { const char dll_file[] = "./dll_plugin1.so"; dll_handle_t h; int e = dll_open(&h, dll_file); if (e) { fprintf(stderr, "%s:Could not open\n", dll_file); perror(dll_file); return 1; } int (*doinit)(void) = dll_func(h, "myinit"); if (!doinit) { perror(dll_file); return 1; } int result = doinit(); /* for this test, output should be 0xcafe */ fprintf(stderr, "result = %#x\n", result); dll_close(h); return 0; }