0
我想從目標C調用CPP函數。我已經在CPP中編寫了函數。我試圖從test.mm文件中調用CPP函數,但我收到以下錯誤消息。CPP與目標C的集成
錯誤:「functionName」在此範圍
我在testCPP.cpp &編寫的功能「functionName」未聲明testCPP.h
請幫我解決這個問題。
//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)
{
......
......
}
請過帳一些代碼。 – xxpor 2010-11-22 13:42:23
'MergeAudioFiles.h'中有什麼? – 2010-11-22 13:53:12
MergeAudioFiles.h就像testCPP.h – jfalexvijay 2010-11-22 13:55:38