问题
I am building an app which uses the latest Facebook SDK (v3.1) and the Windows Azure iOS Toolkit SDK.
Now the Azure SDK requires adding the -all_load and -ObjC flags to the "Other Linker Flags" parameter in Build Settings. This is required to fix the known bug when linking against an Objective-C static libraries that contains categories (see http://developer.apple.com/library/mac/#qa/qa1490/_index.html). Without this setting the Azure SDK generates runtime exceptions of "selector not recognized" when calling certain methods. Fine, problem solved.
However, the Facebook SDK will not build with these flags set. It generates the following error when building:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SLComposeViewController", referenced from:
objc-class-ref in FacebookSDK(FBNativeDialogs.o)
"_SLServiceTypeFacebook", referenced from:
+[FBNativeDialogs composeViewControllerWithSession:handler:] in
FacebookSDK(FBNativeDialogs.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas on how to get these two libraries to play nicely together? One library wants the flags, and the other library won't build with those flags set.
回答1:
Have you added the Social and Accounts Frameworks to your project?
回答2:
Under Targets, General, Linked Frameworks and Libraries add:
Social.framework and Accounts.framework
来源:https://stackoverflow.com/questions/14133153/xcode-linking-issue-when-using-facebook-sdk-and-windows-azure-sdk