dl = dlopen(module_path, RTLD_LAZY); if (!dl) {
fprintf(stderr, "Failed to open module: %s\n", module_path); return;
}
funcptr = dlsym(dl, module_function); if (!funcptr) {
fprintf(stderr, "Failed to find symbol: %s\n", module_function); return;
}
funcptr();
dlclose(dl); #endif
}
int main(int argc, char *argv[])
{
fprintf(stdout, "Hello from program.c\n");
fflush(stdout);
#ifdefined(PLATFORM_WIN) if (!GetModuleFileName(NULL, bin_path, MAX_PATH)) {
fprintf(stderr, "Failed to determine executable path.\n"); return 1;
} #elifdefined(PLATFORM_MAC) || defined(PLATFORM_LINUX) // Using argv[0] should be OK here since we control how the tests run, and // can avoid exec and such issues that make it unreliable. if (!realpath(argv[0], bin_path)) {
fprintf(stderr, "Failed to determine executable path (%s).\n", argv[0]); return 1;
} #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.