12 int main(int argc
, char *argv
[]) {
13 #ifdef DLOPEN_FUNC_DIR
15 void *f1_handle
= dlopen(DLOPEN_FUNC_DIR
"/func.shared", DLOPEN_FLAGS
);
16 if (f1_handle
== NULL
) {
17 fprintf(stderr
, "unable to open '" DLOPEN_FUNC_DIR
"/func.shared': %s\n",
22 void (*func
)(int) = (void (*)(int))dlsym(f1_handle
, "func");
24 fprintf(stderr
, "unable to lookup symbol 'func': %s\n", dlerror());
28 void *f2_handle
= dlopen(DLOPEN_FUNC_DIR
"/func2.shared", DLOPEN_FLAGS
);
29 if (f2_handle
== NULL
) {
30 fprintf(stderr
, "unable to open '" DLOPEN_FUNC_DIR
"/func2.shared': %s\n",
35 void (*func2
)(int) = (void (*)(int))dlsym(f2_handle
, "func2");
37 fprintf(stderr
, "unable to lookup symbol 'func2': %s\n", dlerror());