This had been driving me crazy....
I have an iPhone app that is using an Apple sample cpp file. The cpp file is aqofflinerender.cpp.
When I compile the Apple sample project, AQOfflineRenderTest, it compiles correctly. When I copy the aqofflinerender.cpp file to my project and reference a method within the file exactly as the Apple sample, I get the following error:
cd /Users/mike/Documents/xcode/insultthem
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk "-L/Users/mike/XCode Projects/Debug-iphoneos" "-F/Users/mike/XCode Projects/Debug-iphoneos" -filelist "/Users/mike/XCode Projects/insultthem.build/Debug-iphoneos/insultthem.build/Objects-normal/armv6/insultthem.LinkFileList" -mmacosx-version-min=10.5 -Wl,-dead_strip -miphoneos-version-min=3.0 -framework Foundation -framework UIKit -framework CoreGraphics -framework AVFoundation -framework SystemConfiguration -framework AudioToolbox -framework CoreData -framework MessageUI -framework IOKit -o "/Users/mike/XCode Projects/Debug-iphoneos/insultthem.app/insultthem"
Undefined symbols:
"_DoAQOfflineRender", referenced from:
-[AudioFileManipulation combineFiles:newFileName:] in AudioFileManipulation.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
In .m file, the method is defined as follows:
extern void DoAQOfflineRender(CFURLRef sourceURL1, CFURLRef sourceURL2, CFURLRef sourceURL3, CFURLRef destinationURL);
In the .cpp file, the method is as follows:
void DoAQOfflineRender(CFURLRef sourceURL1, CFURLRef sourceURL2, CFURLRef sourceURL3, CFURLRef destinationURL) {
Does anyone have any suggestions for resolving this?