7

I'm trying to implement admob mediation using the latest admob sdk, and their library requires me to use linker flag -ObjC.

However, after adding this flag, I get linker errors for facebook SDK.

Undefined symbols for architecture armv7: "_SLServiceTypeFacebook", referenced from: +[FBNativeDialogs composeViewControllerWithSession:handler:] in FacebookSDK(FBNativeDialogs.o)
"_OBJC_CLASS_$_SLComposeViewController", referenced from: objc-class-ref in FacebookSDK(FBNativeDialogs.o)

Did anyone else also encounter this?

Haroldo Gondim
  • 7,725
  • 9
  • 43
  • 62
Jeffrey Chee
  • 223
  • 2
  • 15

2 Answers2

17

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

Remember to weak link those, if you are targeting below iOS 6!

Lefteris
  • 14,550
  • 2
  • 56
  • 95
  • I just realized it after re-reading the sdk setup! I wonder why did my app have no problems before i use -ObjC linker flag.. Thanks for the info! – Jeffrey Chee Oct 19 '12 at 01:11
  • Thanks for the reminder. I was going off of the images and didn't see Social selected. I was going crazy why this wasn't working. Thanks! – pir800 Nov 08 '12 at 18:48
2

Do you have -ObjC in other linker flags? This was my problem when I've linked facebook SKD, social and accounts frameworks with this flag (it works when removed). Now I'm trying to figure out the workaround as I need this flag to be used i my project.

JakubKnejzlik
  • 6,363
  • 3
  • 40
  • 41
  • 1
    of course you can add framework standart way by changing required to optional in build phases->link binary with libraries :) – JakubKnejzlik May 09 '13 at 21:43