Apple Mach-O Linker (Id) error - iphone

Got this error for the first time, I have looked around and cannot find a solution to help me, I have cleaned my build and also checked to make sure I am compiling for the latest firmware.
This happened after I tired implementing a reachability solution I found over here
I imported the two reachability files (.m/.h) then added this code into the .m file and delared t in the . h of the reachability files
-(BOOL)reachable {
Reachability*r =[Reachability reachabilityWithHostName:#"enbr.co.cc"];
NetworkStatus internetStatus =[r currentReachabilityStatus];
if(internetStatus ==NotReachable){
return NO;
}
return YES;}
After that I called the function from both of my viwcontrollers viewwillappear methods like so..
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//-- Check Reachability START ---->
Reachability *reach = [[Reachability alloc] init];
if ([reach reachable]) {
NSLog(#"Reachable");
}
else {
NSLog(#"Not Reachable");
}
//-- Check Reachability END ---->
}
No errors were produced untill I tried to build and run in the simulator. This is the error I received :(
Ld
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Products/Debug-iphonesimulator/wizcode.app/wizcode
normal i386
cd "/Users/imac/Documents/Iphone
applications/wizsanCode/wizsanCode.5/wizcode"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH
"/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
-arch i386 -isysroot
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk
-L/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Products/Debug-iphonesimulator
-F/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Products/Debug-iphonesimulator
-filelist
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Intermediates/wizcode.build/Debug-iphonesimulator/wizcode.build/Objects-normal/i386/wizcode.LinkFileList
-mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lz
-framework CoreGraphics -framework MobileCoreServices -framework
SystemConfiguration -framework CFNetwork -framework UIKit -framework
Foundation -o
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Products/Debug-iphonesimulator/wizcode.app/wizcode
ld: duplicate symbol _OBJC_IVAR_$_Reachability.reachabilityRef in
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Intermediates/wizcode.build/Debug-iphonesimulator/wizcode.build/Objects-normal/i386/Reachability-183E2D17A6B26176.o
and
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Intermediates/wizcode.build/Debug-iphonesimulator/wizcode.build/Objects-normal/i386/Reachability-183E2D17A6B26176.o
for architecture i386 collect2: ld returned 1 exit status Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
failed with exit code 1 ld: duplicate symbol
_OBJC_IVAR_$_Reachability.reachabilityRef in
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Intermediates/wizcode.build/Debug-iphonesimulator/wizcode.build/Objects-normal/i386/Reachability-183E2D17A6B26176.o
and
/Users/imac/Library/Developer/Xcode/DerivedData/wizcode-ccyrqptvfsabmbahgxartbvxwurq/Build/Intermediates/wizcode.build/Debug-iphonesimulator/wizcode.build/Objects-normal/i386/Reachability-183E2D17A6B26176.o
for architecture i386
Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
failed with exit code 1

So, the problem has been resolved.
What happened was when I imported the reachability files over into my build something funny was happening and somehow I deleted the reachability files that were already in my build being used by the "all seeing I" ASIHTTPRequest methods I was using for transporting my data... which messed everything up.
So long story short I replaced the files and everything is working fine and I also found out that ASIHTTPTequest is taking care of the reachability for me :) how cool is that.

Check if SystemConfiguration is linked properly. Anyway, clean up your code:
+ (BOOL)reachable {
Reachability *r = [Reachability reachabilityWithHostName:#"enbr.co.cc"];
NetworkStatus internetStatus = [r currentReachabilityStatus];
return internetStatus != NotReachable;
}
And then just call [Reachability reachable] wherever you need. This also fixes a memory leak you have.

Just to add to this, it happened me after I regenerated managed subclasses and it didn't actually overwrite the existing ones but just made new duplicates. I just deleted both and regenerated and it was all good.

After modifying my core data model, I deleted all the (auto generated) NSManagedObjectModel subclasses, and created them again. Once they all were created, I dragged them to a Group folder in XCode... and got the spinning beachball for longer than usual.
The next time I tried to run, it failed with the "Mach-O-Linker" (Id) Error. After reading other responses, I figured it might have something to do with the NSMObj classes not being where expected. I deleted them, quit, opened, generated them, and put them in their customary group folder... and Viola! no Mach-O error.
I see that the problem is resolved, but I post this just to index it under the proper question. In my case, deleting and regenerating (via editor menu) the managed object subclasses fixed the issue.

Remove it then add it again. Works for me. :D

This happens with me when i am adding third party analytics framework in my project. When i check with the info of framework its not properly copied on disk. i download new framework and copied it into project and now there is no error.

I had this code in one of my UIViewController and removing it solved this bug. What a stupid and not-clear-at-all error message
NS_ENUM(NSInteger, Mode) {
Assessments = 0,
Onboarding
};

Make sure you are running YourApp.xcworkspace instead of .xcodeproj file. I did face the same issue when did run .xcodeproj file. Running .xcworkspace has solved the problem and the error has gone away.

Related

duplicate symbol for architecture armv7 error

I'm getting following error after including an external framework and building the project with it. Don't know what to do. Only headers file of the external framework are available to me. All the implementation files (.m) are in a .exe file so I can't access them.
duplicate symbol _OBJC_CLASS_$_AppDelegate in:
/Users/u311107/Library/Developer/Xcode/DerivedData/ConsumerApp-awxafvfmhvwglmdvoobikahakarp/Build/Intermediates/ConsumerApp.build/Debug-iphoneos/ConsumerApp.build/Objects-normal/armv7/AppDelegate.o
/Users/u311107/Desktop/Stash/Mall/consumer/KMCSDK.framework/KMCSDK(AppDelegate.o)
duplicate symbol _OBJC_METACLASS_$_AppDelegate in:
/Users/u311107/Library/Developer/Xcode/DerivedData/ConsumerApp-awxafvfmhvwglmdvoobikahakarp/Build/Intermediates/ConsumerApp.build/Debug-iphoneos/ConsumerApp.build/Objects-normal/armv7/AppDelegate.o
/Users/u311107/Desktop/Stash/Mall/consumer/KMCSDK.framework/KMCSDK(AppDelegate.o)
ld: 2 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please help.
Thanks.
It seems like, KMCSDK.framework has already declared an AppDelegate class, if you can not modify the source code of KMCSDK.framework and rebuild it, you should rename AppDelegate in your project to fix this problem.

Error in ASIHTTP class [duplicate]

When trying to compile with Xcode, I am getting the following error:
**Ld /Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator/iKosher.app/iKosher normal i386
cd /Users/doronkatz/Sites/xCode/iKosher
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Xcode4/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Xcode4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Xcode4/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Xcode4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator -L/Users/doronkatz/Sites/xCode/iKosher -F/Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator -filelist /Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Intermediates/iKosher.build/Debug-iphonesimulator/iKosher.build/Objects-normal/i386/iKosher.LinkFileList -mmacosx-version-min=10.6 -all_load -ObjC -Xlinker -objc_abi_version -Xlinker 2 -lz -framework Security -framework CFNetwork -framework CoreData -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -o /Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator/iKosher.app/iKosher
Undefined symbols for architecture i386:
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassMIMEType", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassFilenameExtension", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostName:] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability currentReachabilityStatus] in Reachability.o
-[Reachability isReachable] in Reachability.o
-[Reachability isConnectionRequired] in Reachability.o
-[Reachability isConnectionOnDemand] in Reachability.o
-[Reachability isInterventionRequired] in Reachability.o
-[Reachability isReachableViaWWAN] in Reachability.o
-[Reachability isReachableViaWiFi] in Reachability.o
...
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status**
Not sure what it means.
If you get this sort of thing appearing suddenly, it usually means the project is missing some frameworks it needs. Libraries and dependent projects can require frameworks, so if you've added one recently then that can cause this error.
To add frameworks, right click on the project name in the project view, select Add, then select Existing frameworks... from the list. Then find the framework with the symbols you're missing.
As to how you find which frameworks you need, I've found using google the easiest, though you could probably use the Xcode help search too. Search for one of the symbols, doing your best to work out the unmangled name (e.g., SCNetworkReachabilityGetFlags), and then the first documentation link you find at developer.apple.com is often the right one. You usually don't have to hunt very far. In this case, that's this page:
https://developer.apple.com/documentation/systemconfiguration/scnetworkreachability-g7d
Then at the top of the page, it tells you which framework to use, SystemConfiguration in this case. So add that to the project, and compile again.
Then just keep doing this until it works...
Edit: I've never used the simulator, but this is what you do on the device - I assume it's the same...
Sometimes there are source files which are missing from your target.
examine which symbols are missing
target->build phases->compile source
add the missing source files if they are not listed
command+b for bliss
You can select the files that seem to be "missing" and check in the right-hand utility bar that their checkboxes are selected for the Target you are building.
You are using ASIHTTPRequest so you need to setup your project. Read the second part here
https://allseeing-i.com/ASIHTTPRequest/Setup-instructions
I solved it using the following method (for XCode 4):
1) Select the project in the project navigation window which will show project summary on right
2) Select 4th tab build phases
3) Select Link binary with library option
4) Add framework for which you are getting
5) Move the framework from main folder to the frameworks folder
6) Build it again and errors are gone.
The problem is that target membership for the added filed is missing to the app target .So select the file and add the checkmark to the box of target membership
For example if the error shown in a method definition in common.m
Thought to add my solution for this, after spending a few hours on the same error :(
The guys above were correct that the first thing you should check is whether you had missed adding any frameworks, see the steps provided by Pruthvid above.
My problem, it turned out, was a compile class missing after I deleted it, and later added it back in again.
Check your "Compile Sources" as shown for the reported error classes. Add in any missing classes that you created.
Make sure that the missing framework is actually listed under "Target/Build Phases/Link Binary With Libraries" if not just add it. As mentioned before it usually indicates a missing framework.
In my project there were two identical framework listed, when I removed one of them I had this error, because it also removed it form the the "Link Binary With Libraries" list.
I added back and the problem disappeared (and I still have two frameworks listed)
I fixed a similar error on my project by changing the Build Settings > Architectures for ALL of my targets.
The problem:
When I upgraded from Xcode 4.4 to Xcode 4.5, my project still compiled fine on the simulator but did not compile on devices. On devices it threw the error "symbol(s) not found for architecture armv7s," along with the misleading "Apple Mach-O Linker Error" and "clang: error: linker command failed with exit code 1 (use -v to see invocation)."
The cause (in my case):
My project had multiple targets, and even though the Build Settings > Architectures for the main target was set to include armv7s architecture, the main target depended on another target (listed under Build Phases > Dependencies), and I hadn't thought to reset the Build Settings > Architectures for that other target, and I had to change that to include armv7s.
I suppose the simulator and device run on different architectures, and that's why the simulator was OK while the device wasn't.
Does your project depend on another project, and is that a target in that project set up to be a direct dependency of your main target? If this is the case and the dependency isn't set up, the dependent target may not be getting built for all configurations (i.e. the simulator)
Just a wild guess.
Another situation that can cause this problem is if your code calls into C++, or is called by C++ code. I had a problem with my own .c file's utility function showing up as "symbol not found" when called from Obj-C. The fix was to change the file type: in Xcode 4, use the extended info pane to set the file type to "Objective-C++ Source"; in Xcode 3, use "Get Info" to change file type to "source.cpp.objcpp".
In my case none of the posted solutions worked. I had to delete the project and make a fresh checkout from the SVN server. Lucky me the project was hosted in a version control system. Don't know what I'd do otherwise.
In a C++ project using a defined templatized class, while receiving the same error, I selected .cpp file with the defined templatized class in the Project Navigator, then Delete > Remove Reference. Also the associated .h file, while still referenced in the project, needs to have a #include statement to the .cpp as follows:
#ifndef __CircularBuffer__CircularBufferT__
#define __CircularBuffer__CircularBufferT__
... snip ...
#include "CircularBufferT.cpp"
#endif /* defined(__CircularBuffer__CircularBufferT__) */
If you want to see, a simple project example is on github:
This is a little bit of indirection trickery and I don't recall the original source of this workaround.
If this error appears suddenly, it means the project is missing some frameworks. Libraries and dependent projects can require frameworks, so if you've added one recently then that can cause this error.
To add frameworks, right click on the project name in the project view, select Add, then select Existing frameworks from the list. Then find the framework with the symbols you're missing.
The other thing is if you added any classes in the compiled resources and removed that classes from the project then the error appears. The best thing to do is remove the classes from the compile resources(Build settings--> compile sources) which have removed from the project.
In my case i have added the admob classes in the project and compiled the project. In a later case i dont want to include admobs in my project so i deleted the references of the admob classes from my project. When this error occurred i deleted the .m class of my admob from compile resources solved this problem.
This happened to me while trying to copy over the PSPDFKIT demo library into my project. I followed all the instructions in the site + all the suggestions on this page.. for some reason it kept on giving the above error, the problem was that if i grepped the message in the error method.. it only appeared in the binary (obviously I have no access to the source code b/c I have to pay for it).
I noticed this in the instruction page though:
So I went to the guts of that config file and found this:
OTHER_LDFLAGS=$(inherited) -ObjC -fobjc-arc -lz -framework CoreText -framework CoreMedia -framework MediaPlayer -framework AVFoundation -framework ImageIO -framework MediaPlayer -framework MessageUI -framework CoreGraphics -framework Foundation -framework QuartzCore -framework AVFoundation -framework CFNetwork -framework MobileCoreServices -framework SystemConfiguration -weak_framework UIKit
Then I went to the sample project provided by the author of the said library.. and noticed that the previous flags where copied verbatim to the other linker flags in my build settings.. however in my project.. they were not!.. So i simply copied and pasted them into my project's build settings other linker flags and everything worked!
take away point: if you are relying on some .xcconfig file on your setup, double check with a sample code source or something and make sure that it has actually been applied.. it wasn't applied properly in my case
Another reason this could be happening is when you UPGRADE an SDK.
If you simply delete the group, and then drag and drop the new folder to project, the "Library Search Path" would have both the SDKs. To solve, simply delete the old SDK path.
I had used a CLGeocoder without adding a Core.Location Framework. Basically this error can mean multiple things. I hope this helps someone else.
I've been stumped by this one before only to realize I added a data-only #interface and forgot to add the empty #implementation block.
Came across this issue in Xcode 11, fix was changing the Minimum Deployment Target from 10.0 to 11.0, hope this helps someone :)

Added frameworks not detected by XCode

I'm trying to add frameworks to my project. I add them through Build Phases -> Link Binary With Libraries -> "+ button". When they are added they appear red and if I try to compile my code I get:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIHTTPRequest", referenced from:
objc-class-ref in LoginViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
After a while the frameworks return to black text in the Build Phases tab but the code will still not compile. The files are all intact in the folders and the location is "Relative to SDK" like all the other working frameworks. I had this problem before, when the framework in question was also saved in my project folder, but that is not the case this time. I have read many other threads on this topic but they seem to be about an earlier version of XCode. Help is much appreciated.
EDIT: I am trying to add the MobileCoreServices and CFNetwork frameworks. LoginViewController is part of my project.
EDIT: I have the same error whether the framework is included or not. I think that is because XCode cannot find the frameworks for some reason after I have included them. Here is where I use classes that reference the framework. This is from the LoginViewController
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL: url];
[request setCompletionBlock:^{
NSLog(#"File downloaded.");
//NSData *data = [request responseData];
//do stuff with data
}];
[request setFailedBlock:^{
NSError *error = [request error];
NSLog(#"Error downloading file: %#", error.localizedDescription);
}];
[request startAsynchronous];
I'm trying to make an asynchronous server call to get data.
EDIT: Okay so it turns out the target membership of some .m files in my project was not checked. After fixing this I still have a similar issue. Here is my new error
Undefined symbols for architecture i386:
"_kReachabilityChangedNotification", referenced from:
+[ASIHTTPRequest registerForNetworkReachabilityNotifications] in ASIHTTPRequest.o
+[ASIHTTPRequest unsubscribeFromNetworkReachabilityNotifications] in ASIHTTPRequest.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have researched this and the only cause seems to be that the MobileCoreServices and CFNetwork frameworks are missing. This is what I thought the original problem was caused by. I included the frameworks but XCode acts like they aren't there.
They have changed the default so it doesn't add target membership. Select the every .m file and in the right navigator you can select "Target membership". Be sure to select the checkbox for every file you are using.

Error using Reachability.h on Xcode 4.0

I am having some problems adding Reachability to my project. I just used Reachability before, but this time I am failing. I always having the error below:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in DelegatePrincipal.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My project don't use ARC (and I don't want it), base sdk 5.0, ARchitecture standard (armv7) and I already add the SystemConfiguration.framework.
I also tested the Tony million Reachability and it does not work. Same problem.
I saw the same question from other topics, but it was with ARC. My project does not have ARC.
Additionally, i am doing a simple test inside the delegate, as follows:
Reachability *reach = [Reachability reachabilityForInternetConnection];
NetworkStatus netStatus = [reach currentReachabilityStatus];
if (!netStatus == NotReachable) {
NSLog(#"Not connected");
}
Thanks!
Are you sure you added the Reachability.m file to your project?
Check also if it is assigned to your current target.
That error definitely means that the linker did not find the class definition anywhere among the binaries produced by the compiler for the armv7 architecture.
Add Message UI framework in your project..
Hope, this will help you...enjoy..

xcode iphone program using .cpp file: symbol not found

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?
Ok... Figured it out.... according to another post, in the aqofflinerender.cpp file, I surrounded the function as follows:
#if __cplusplus
extern "C" {
#endif
void DoAQOfflineRender(CFURLRef sourceURL, CFURLRef destinationURL)
{
...
}
#if __cplusplus
}
#endif
Weird.... cause it works in the Apple example without the #if __cplusplus lines. Guessing that there is a compiler option missing in my project...
These lines tell the compiler to export the function name as the symbol so the other classes can "see" the function.
Doesn't the Apple code come with an include file too? Usually, example code made from Apple always has an include file.
If there is that file, you need to use it too, I think.
Have you tried changing the .cpp file to a .mm file? I vaguely remember something like that's what the compiler expects when there's a mix of objective-c and c++.