main.dylib is the exported library. shownow is the exported method in main.dylib.
int main (int argc, const char * argv[]) {
char* lib_name = "./main.dylib";
void* lib_handle = dlopen(lib_name, RTLD_NOW);
if(lib_handle)
{
void (*shownow)(void) = dlsym(lib_handle, "shownow");
if(shownow)
{
shownow();
}
}
return 0;
}
No comments:
Post a Comment