Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode linking issue when using Facebook SDK and Windows Azure SDK

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.

like image 266
Joel Avatar asked Jan 03 '13 04:01

Joel


2 Answers

Have you added the Social and Accounts Frameworks to your project?

like image 199
Vishal Avatar answered Oct 16 '22 12:10

Vishal


Under Targets, General, Linked Frameworks and Libraries add:

Social.framework and Accounts.framework

like image 33
Abdul Rahman Khan Avatar answered Oct 16 '22 13:10

Abdul Rahman Khan