Search code examples
ioscordovafacebook-ios-sdk

Mach-O Linker reference error, but can't find the source file


I'm trying to add facebook connect login to my phonegap/cordova app using the https://github.com/mgcrea/cordova-facebook-connect plugin.

When I go to build the app, I get an error

Apple Mach-O Linker Error
"_OBJC_CLASS_$_Facebook", referenced from:
     objc-class-ref in FacebookConnect.o
     (maybe you meant: _OBJC_CLASS_$_FacebookConnect)
ld: symbol(s) not found for architecture armv7
clang: error: linker caommand failed with exit code 1 (user -v to see invocation)

I've been going through my files, and don't have any file called FacebookConnet.o, just FacebookConnect.h and FacebookConnect.m in my plugins directory, and a Facebook.h within the FacebookSDK.framework.

-Plugins
   FacebookConnect.h
   FacebookConnect.m
   -FacebookSDK.framework
       -headers
          Facebook.h
          FacebookSDK.h
          etc, etc, etc

Is the .o file created during the build, and if so, hwo can I find where this error might be so I can try to fix it? Or any other suggestions on resolving this?


Solution

  • Go to your Facebook.h, show Utilities (right tab), and click on File Inspector.

    Is your project in Target Membership checked? If not, make sure it's checked and try again.