Swift: How to call a C function loaded from a dylib
Calling the add function from Swift is possible because you defined it to have C linkage with extern “C”. Making the library a Swift module (as suggested by jtbandes in above comments) might be the better solution, but here is how you can use the function pointer return by dlsym() from Swift: First add typedef … Read more