extern "C" can do the trick. I can get the C functions to compile and reference by doing something like this in both the implementation declaration and the header. Here is a simple example:
#if __cplusplus
extern "C" {
#endif
double DegreesToRadians(double degrees);
double RadiansToDegrees(double radians);
#if __cplusplus
}
#endif
Implementation File:
#import "Math.h"
#if __cplusplus
extern "C" {
#endif
double DegreesToRadians(double degrees) {return degrees * M_PI / 180;};
double RadiansToDegrees(double radians) {return radians * 180/M_PI;};
#if __cplusplus
}
#endif
source
share