I get the following error when trying to compile my project in xcode 4 (worked fine in xcode 3.x)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBLoginDialog", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBStreamDialog", referenced from:
objc-class-ref in View1Controls.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Can anyone explain whats wrong? I'm sure I've correctly imported the header files..
Thanks,
Jack
Assuming the libraries with these functions are included in the Xcode project, this error occurs when the libraries are not linked with the binary executable file. This can happen when upgrading an older project to a newer version of Xcode.
To fix it navigate to the project overview in Xcode. Click on the target. Click on Build Phases. Expand the "Link Binary With Libraries" list. If libraries are not listed, click the "+", and add the appropriate libraries.
You are missing a library/framework which caused the linker errors that you see. I'm not sure which framework is associated with Facebook functionality, it might be the general network related one. Let me see if I can find out which you need.
EDIT: Do you have the Foundation framework included with your project? Does the Facebook site maybe mention which one you need?
I don't work with facebook, but here's my thoughts:
That's a linker error, not a compiler one (which it would be if the header weren't imported). Have you imported the correct framework? And ensured XCode is telling the compiler to link to the correct library?
Its related to linker error. So just remove facebook framework from project and drag new one.
Remove existing facebook framework
Drag FacebookSDK.framework folder from the SDK installation folder into the Frameworks section of your project
Related
I've read close to 50 threads on here, regarding linking frameworks to an Xcode project, but I've yet to find one that covers an issue I'm having with Facebook's Audience Network framework.
I'm using Xcode 4.2.3 (I'm on an old mac with OS X Lion - don't ask!), building for iOS 6.1, using Facebook SDK 3.2.1.
I'm trying to test banner ad formats within specific view controllers, however, getting an error every time I build the code, based exactly on the tutorials, even Facebook's sample code isn't compiling. I've added FBAudienceNetwork.framework to almost every folder on my machine, added via dragging and dropping, and via the Link Binary with Libraries option. I've tried to changing the Framework Search paths, to no avail.
I'm using the following frameworks: AdSupport, StoreKit, CoreMotion, UIKit, Foundation, CoreGraphics
Getting the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CAShapeLayer", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdChoicesView.o)
"_OBJC_CLASS_$_CATransaction", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o)
objc-class-ref in FBAudienceNetwork(FBAdMediumRectangleView.o)
"_OBJC_CLASS_$_NSURLSession", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o)
"_kCATransactionDisableActions", referenced from:
-[FBAdMediumRectangleView updateViewForSize:view:] in FBAudienceNetwork(FBAdMediumRectangleView.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestions?
UPDATE: Added in Quartzcore.framework, and errors now reduced to;
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NSURLSession", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've made Foundation.framework optional. Build settings armv7, armv7s, iOS 6.1, Simulator only. Build Active Architecture ONLY Yes/No.
I'm a software engineer on the Audience Network team at Facebook, and I have some suggestions that may help.
Try adding "QuartzCore.framework" to your target. That should resolve the _OBJC_CLASS_$_CA* linker errors. Classes with a "CA" prefix are part of QuartzCore/Core Animation.
If the "_OBJC_CLASS_$_NSURLSession" error still appears, try weak-linking the Foundation framework by setting the "Foundation.framework" to "optional" in Build Phases, Link Binary With Libraries.
You should be able to successfully build after those steps. Hope that helps!
NSURLSession was added in iOS 7.0. Any improper reference to it in your app will cause this problem when ran on a device with iOS 6.0. You need to use proper techniques to ensure the class is never referenced under iOS 6.0 or make your deployment target iOS 7.0.
i am new in ios developement.i have a project while run on ios 5.1 simulater it is working fine and not getting any error but in that same project while run on ios 6.0, ios 6.1 simulator i am getting following errors.Can anyone suggest me how can i rectify this problem?
Errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GDataOAuthAuthentication", referenced from:
objc-class-ref in GDataOAuthViewControllerTouch.o
"_OBJC_CLASS_$_GDataOAuthSignIn", referenced from:
objc-class-ref in GDataOAuthViewControllerTouch.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Try this,
The main problem was,I thought you are using old GData sdk. You just
change the compiler to LLVM GCC 4.2 from Apple LLVM 4.2 and it
compiles app perfectly.
i have attached screenshot for your reference
Project->Target->Build Settings->Build options
You're linking against external libraries that haven't been compiled for your current architecture/SDK version. I see you're using VDOAds library, which was probably precompiled against the 5.1 SDK. You'll need to get a version that was precompiled for the latest iOS SDK.
TargetSettings -> Build Phases -> Compile Sources and make sure that these missing libraries are included there.
So you have two problems, for the warnings, the libraries were added to your Build Phases but they were deleted from the project and they are still there.
For the error, the library that you are using is not added to Build Phases -> Link Binary With Libraries.
So in order to fix this warnings/errors, go to your project Targets -> Build Phases -> Link Binary With Libraries, and search for libGoogleAnalytics (I think this is the one for GA) and remove it (if not needed).
Also add the VDOAds library there in order to fix the error.
I also add a screenshot with the targets, it will be easier to find it if you don't know about it.
I am new to iphone develop and phonegap also. Now i want to create simple iphone app using phonegap. Now i am using phonegap2.0 in lion mac. MY Xcode version is 4.3. Now my issue is after install the phonegap2.0 in xcode when i run the Xcode in my Simulator 5.0. I got this below error.
"Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_ViewController in ViewController.o
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_ViewController in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
Please help me to solve this issue. Thanks in Advance.
And i have attach the Screen Shot of error page for your reference.
Check if your project links libCordova.a (in my case Xcode forgot about the reference, when moving CordovaLib.xcodeproj to another location).
select your project in the Project Navigator
go to the Summary tab
drag CordovaLib.xcodeproj > Products > libCordova.a to Linked Frameworks and Libraries
Clean & build.
Please check your ViewController.m file and goto to
1. Build phase in xcode
2. Select Compile Sources
3. Press + button to add .m/.mm file
I think it will run successfully now
Remove armv7s from your build settings, for both your project and the referenced subproject Cordova. Set your target to 4.3.
I had a similar issue. Somehow my the NSManagedObject Sub-classes of my Core Data entities were in the Compile Sources table twice. The compiler would choke when it hit the first of these duplicates.
I just went into the Compile Sources table and deleted the second occurrence of each .m listing.
Some simple things sometimes just don't work ;) like this one! Am trying to integrate Google+ SDK into an iPhone App by following the instructions given here:
https://developers.google.com/+/mobile/ios/#initialize_the_google_client
I did every single step. But when I build the App, it complains of the following errors:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_GTMOAuth2Keychain", referenced from:
objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
"_OBJC_CLASS_$_GTMOAuth2SignIn", referenced from:
objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
"_OBJC_CLASS_$_GTMOAuth2ViewControllerTouch", referenced from:
objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The classes it's reporting of, are part of the Open Source Google Toolbox project (which is also present in the downloaded SDK, but the instructions ask the user to include only GooglePlusShare.h and libGooglePlusUniversal.a in the project in XCode). I tried including the header files from the directory 'google-plus-ios-sdk-1.0.0\OpenSource', but that's of no use. I tried including the entire (not just .h files) from the directory 'google-plus-ios-sdk-1.0.0\OpenSource' & it leads to lot of ARC related errors (more than 500 of them!); so I quit this option.
Any help on how to resolve these linker errors please?
My environment: XCode 4.3.3, iOS 5.0, Mac OS X Lion 10.7.4, testing with iPhone 4
Just select GData.xcodeproj .
select GDataTouchStaticLib from target .
search "othet c flag"
remove "-DGTM_INCLUDE_OAUTH2=1" if exist
add "-DGDATA_INCLUDE_OAUTH2=1"
click on done. clean project and then build.
Missing keychain and auth-stuff usually means you never imported the Security.framework in your project.
Check another time if you really did include the libraries
Security.framework
SystemConfiguration.framework
in your Xcode project as described in step 1 of the instructions you referred to.
To verify this:
Click on your project name in xcode and select your target.
Under the tab "Build Phases" these two frameworks should be listed under the secition called "Link Binary With Libraries".
If not listed, press the + button to add them.
I am trying to create a photo gallery in my app, I tried to use Three20 and EGOPhotoViewer. I would like to use EgoPhotoViewer but I am new at programming and I don't know how to install EgoPhotoViewer to my app. When I try to use it I got this error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MyPhoto", referenced from:
objc-class-ref in MasterViewController.o
"_OBJC_CLASS_$_MyPhotoSource", referenced from:
objc-class-ref in MasterViewController.o
"_OBJC_CLASS_$_EGOPhotoViewController", referenced from:
objc-class-ref in MasterViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there any way of doing this?
If EGOPhotoViewer is just a couple of classes (which is what it sounds like), then drag them into your project and #import and #class them in the proper files. If it's a framework, then drag it into your project and make sure that it is being linked in build settings, then #import <> the necessary header.
Your undefined symbols error just means that you're trying to reference an invisible, non-existent, or out of reach class.
EDIT: For future reference because I know you're still a beginner. When you see "Undefined symbols for architecture XXXX"; the XXXX is the MOST important part. If it says armv6 or armv7, then you have a device build problem. If it says "i386", that's a simulator problem. I'm going to guess that the classes for EGOPhotoViewer are universal, but there are cases where the dunderheads decided not to build for the simulator (Dropbox anyone?) and undefined symbols for architecture i386 would come up.