12

I just upgraded Facebook iOS SDK to v.4.0.1 and I got these errors:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FBSDKLoginManager", referenced from:
      objc-class-ref in Controller1.o
      objc-class-ref in AppDelegate.o
      objc-class-ref in Controller2.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I already tried to change linkers: with -all_load I get the same error, while with -force_load it becomes "ld: file not found: -fobjc-arc". Any solutions?

Luciano
  • 1,208
  • 2
  • 17
  • 36

3 Answers3

30

I ran into the same problem. If you're adding Facebook Login to your app (which I presume you are) you also need to drag the FBSDKLoginKit.framework file into your Xcode project in addition to the FBSDKCoreKit.framework file.

The current instructions on Facebook's SDK Getting Started page forget to mention this. In version < 4 of the SDK, there was just one file to drag in to your project.

Arash Payan
  • 1,793
  • 1
  • 17
  • 19
  • 1
    I did this because for now it's the only way it worked, but the size of the app increases (I had to add Login and Share frameworks) and that's not cool. I'd like to know if everyone had this problem, I couldn't find anything here on SO... – Luciano Apr 14 '15 at 07:28
  • This is the correct answer, in my case i have to include `FBSDKShareKit.framework` to build successfully. – Umair Mar 24 '16 at 12:08
  • When Add FBSDKCoreKit.framework, FBSDKLoginKit.framework getting error , clang: error: linker command failed with exit code 1 (use -v to see invocation) – Vineesh TP Nov 04 '17 at 13:43
0

if you are trying to add it using cocoapods just add versions and it will work

change the pod file to the following:

pod 'FBSDKCoreKit', '~> 4.17.0'
pod 'FBSDKLoginKit', '~> 4.17.0'
pod 'FBSDKShareKit', '~> 4.17.0'
0

It really worked for Xcode 12.5. Just added versions:

pod 'FBSDKCoreKit', '~> 11.2.1'
pod 'FBSDKLoginKit', '~> 11.2.1'
pod 'FBSDKShareKit', '~> 11.2.1'

With this option, errors appear and the project is not being built:

pod 'FBSDKCoreKit',
pod 'FBSDKLoginKit',
pod 'FBSDKShareKit',