iOS-.mm文件引用C方法

在一个OC类Log.h中定义了一个C方法,在Demo.mm中引用C方法的时候报错Undefined symbols for architecture arm64
解决:

// 如果项目中有.mm文件__cplusplus就为真,就把包括的代码部分按照C编译
#ifdef __cplusplus
extern "C" {
#endif
void XXLogDebug(NSString *format, ...);
#ifdef __cplusplus
}
#endif

你可能感兴趣的:(iOS-.mm文件引用C方法)