我想从目标C调用一个CPP函数。我已经用CPP编写了这个函数。我试图从test.mm文件调用CPP函数,但收到以下错误消息。
错误:“functionName”未在此作用域中声明
我已经在testCPP.cpp&testCPP.h中编写了函数“functionName”
请帮我解决这个问题。
//Objective-C (.mm)
#import "MergeAudios.h"
#import "MergeAudioFiles.h" // cpp header file
@implementation MergeAudios
-(void)mergeAudioFile1:(CFURLRef)path1 file2:(CFURLRef)path2 withFile:(CFURLRef)path3{
CombineAudioFiles(path1, path2, path3);
}
@end
// CPP (.cpp)
void CombineAudioFiles(CFURLRef sourceURL1, CFURLRef sourceURL2, CFURLRef destinationURL)
{
......
......
}