Sudden undefined symbols for architecture i386 - ios5

I have a project that built and ran yesterday, but today it doesn't link. I didn't change anything. I don't know what would cause this. I don't see main.o and _main that it is referring to. Any ideas? I tried a clean and build. I looked at a couple of things on this site but don't see anything that's clueing me in.
Ld /Users/michelecleary/Library/Developer/Xcode/DerivedData/Hackbook-dpdqkbplprywqfeflsbqlgpwbioo/Build/Products/Debug-iphonesimulator/Hackbook.app/Hackbook normal i386
cd /Users/michelecleary/fbPic2/facebook-ios-sdk/sample/Hackbook
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/michelecleary/Library/Developer/Xcode/DerivedData/Hackbook-dpdqkbplprywqfeflsbqlgpwbioo/Build/Products/Debug-iphonesimulator -F/Users/michelecleary/Library/Developer/Xcode/DerivedData/Hackbook-dpdqkbplprywqfeflsbqlgpwbioo/Build/Products/Debug-iphonesimulator -filelist /Users/michelecleary/Library/Developer/Xcode/DerivedData/Hackbook-dpdqkbplprywqfeflsbqlgpwbioo/Build/Intermediates/Hackbook.build/Debug-iphonesimulator/Hackbook.build/Objects-normal/i386/Hackbook.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -o /Users/michelecleary/Library/Developer/Xcode/DerivedData/Hackbook-dpdqkbplprywqfeflsbqlgpwbioo/Build/Products/Debug-iphonesimulator/Hackbook.app/Hackbook
Undefined symbols for architecture i386:
"_objc_msgSend", referenced from:
_main in main.o
-[HackbookAppDelegate application:didFinishLaunchingWithOptions:] in HackbookAppDelegate.o
-[HackbookAppDelegate applicationDidBecomeActive:] in HackbookAppDelegate.o
-[HackbookAppDelegate application:handleOpenURL:] in HackbookAppDelegate.o
-[HackbookAppDelegate application:openURL:sourceApplication:annotation:] in HackbookAppDelegate.o
-[HackbookAppDelegate dealloc] in HackbookAppDelegate.o
-[RootViewController dealloc] in RootViewController.o
...
"_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
objc-class-ref in main.o
"_NSLog", referenced from:
-[HackbookAppDelegate applicationDidBecomeActive:] in HackbookAppDelegate.o
-[RootViewController fbDidExtendToken:expiresAt:] in RootViewController.o
-[RootViewController request:didFailWithError:] in RootViewController.o
-[APICallsViewController apiGraphUserPhotosPost] in APICallsViewController.o
-[APICallsViewController request:didFailWithError:] in APICallsViewController.o
-[APICallsViewController dialogCompleteWithUrl:] in APICallsViewController.o
-[APICallsViewController dialogDidNotComplete:] in APICallsViewController.o
...

Related

What does the error mean?

Ld /Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator/Video.app/Video normal i386
cd "/Users/michaelsonsamuels/Desktop/Xcode /Video"
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator -F/Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator -filelist /Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Intermediates/Video.build/Debug-iphonesimulator/Video.build/Objects-normal/i386/Video.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework StoreKit -framework AudioToolbox -framework MessageUI -framework SystemConfiguration -framework CoreGraphics -framework UIKit -framework Foundation -o /Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator/Video.app/Video
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GADBannerView", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_GADRequest", referenced from:
objc-class-ref in ViewController.o
"_kGADAdSizeBanner", referenced from:
-[ViewController viewDidLoad] 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)
Ld /Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator/Video.app/Video normal i386
cd "/Users/michaelsonsamuels/Desktop/Xcode /Video"
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator -F/Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator -filelist /Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Intermediates/Video.build/Debug-iphonesimulator/Video.build/Objects-normal/i386/Video.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework StoreKit -framework AudioToolbox -framework MessageUI -framework SystemConfiguration -framework CoreGraphics -framework UIKit -framework Foundation -o /Users/michaelsonsamuels/Library/Developer/Xcode/DerivedData/Video-hedtrampxpseetfcmcksycqvmpuk/Build/Products/Debug-iphonesimulator/Video.app/Video
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GADBannerView", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_GADRequest", referenced from:
objc-class-ref in ViewController.o
"_kGADAdSizeBanner", referenced from:
-[ViewController viewDidLoad] 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)
"_OBJC_CLASS_$_GADBannerView", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_GADRequest", referenced from:
objc-class-ref in ViewController.o
"_kGADAdSizeBanner", referenced from:
-[ViewController viewDidLoad] 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)
Thanks.
Your classes are missing from Build target. I don't know about your project structure and files but it looks like GADBannerView and GADRequest classes are missing.
Remove these files from your project. add them again and remember to check "ADD TO TARGET" checkbox.
Add the libGoogleAdMobAds.a to the Linked Frameworks and Libraries.
this error shows that u haven't added GADBannerView, and GADRequest classes.
please check by following this steps:
in XCode select your Project in the Target Section then switch to BuildPhases->CompileSources
here check for GADBannerView.m and GADRequest.m files.
XCode->Your Project in Target section->BuildPhases->CompileSources
hope this will help you.

Obj-class-ref error when compiling for an iPhone

Ld /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator/sampleResource.app/sampleResource normal i386
cd /Users/rajeshmedampudi/Dropbox/Work/iphone/sampleResource
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator -F/Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator -filelist /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Intermediates/sampleResource.build/Debug-iphonesimulator/sampleResource.build/Objects-normal/i386/sampleResource.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator/sampleResource.app/sampleResource
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_User", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_AuthenticationViewController", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_AppHelpers", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
this is the error I am getting when I try to run the file ... I have imported those classes from another project into this one which was non arc based and converted to ARC. I got this error after successfully removing all the references to autorelease and retains from it.
Did you try Product->Clean?
Or restarting XCode?
Did you make sure you've included everything in the Targets->Build Phases->Compile Sources? Xcode does this for you, but sometimes it misses things.

GameKit / GameCenter - I386

I'm having some hard time with the iOS GameCenter
I'm following some tutorials on youtube
but as soon as I finish the code I get this error:
Ld /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test normal i386
cd /Users/fgringo/Documents/DEVELOPER/Game-Center-Test
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator -F/Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator -F/Users/fgringo/Documents/DEVELOPER/Game-Center-Test -filelist /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Intermediates/Game-Center-Test.build/Debug-iphonesimulator/Game-Center-Test.build/Objects-normal/i386/Game-Center-Test.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework GameKit -framework MediaPlayer -o /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test
ld: warning: ignoring file /Users/fgringo/Documents/DEVELOPER/Game-Center-Test/GameKit.framework/GameKit, missing required architecture i386 in file
ld: warning: ignoring file /Users/fgringo/Documents/DEVELOPER/Game-Center-Test/MediaPlayer.framework/MediaPlayer, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GKLocalPlayer", referenced from:
objc-class-ref in GameCenterManager.o
"_OBJC_CLASS_$_GKLeaderboard", referenced from:
objc-class-ref in GameCenterManager.o
"_OBJC_CLASS_$_GKScore", referenced from:
objc-class-ref in GameCenterManager.o
"_OBJC_CLASS_$_GKAchievement", referenced from:
objc-class-ref in GameCenterManager.o
"_OBJC_CLASS_$_GKPlayer", referenced from:
objc-class-ref in GameCenterManager.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
It looks like you haven't added the GameKit framework to your project.
If your using Xcode 3.2.x:
Right click the Frameworks group/folder in the file tree (on the left of the xcode window)
Press Add, and then select Existing Frameworks...
Scroll to GameKit.framework and double click it
If your using Xcode 4:
In the file tree, click on the project (the item at the top)
Select your target
Go to the Build Phases tab on the main panel
Expand the Link Binary with Libraries
Press the + button
Scroll to the GameKit.framework and double click it.
Did you add the GameKit.framework to your project?

SCNetworkReachability Errors in PinkelStar App

I am trying to add PinkelStar Sharing function to my own app, I follow every step the instruction says, but it did not turn out to be the way it should be. I am a newer to iPhone development, question might be stupid.
Ld build/Debug-iphonesimulator/ButtonTest.app/ButtonTest normal i386
cd /Users/spzhang/Documents/IphoneProject/ButtonTest
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/spzhang/Documents/IphoneProject/ButtonTest/build/Debug-iphonesimulator -F/Users/spzhang/Documents/IphoneProject/ButtonTest/build/Debug-iphonesimulator -F/Users/spzhang/Documents/IphoneProject/ButtonTest/../PinkelStar-pinkelstar-iOS-demo-359a5be -filelist /Users/spzhang/Documents/IphoneProject/ButtonTest/build/ButtonTest.build/Debug-iphonesimulator/ButtonTest.build/Objects-normal/i386/ButtonTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework PinkelStar -o /Users/spzhang/Documents/IphoneProject/ButtonTest/build/Debug-iphonesimulator/ButtonTest.app/ButtonTest
Undefined symbols:
"_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
-[PSReachability startNotifier] in PinkelStar(Reachability.o)
"_SCNetworkReachabilityGetFlags", referenced from:
-[PSReachability currentReachabilityStatus] in PinkelStar(Reachability.o)
-[PSReachability connectionRequired] in PinkelStar(Reachability.o)
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[PSReachability reachabilityWithAddress:] in PinkelStar(Reachability.o)
"_OBJC_METACLASS_$_MFMailComposeViewController", referenced from:
_OBJC_METACLASS_$_PSMailViewController in PSMailViewController.o
"_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
-[PSReachability stopNotifier] in PinkelStar(Reachability.o)
"_SCNetworkReachabilityCreateWithName", referenced from:
+[PSReachability reachabilityWithHostName:] in PinkelStar(Reachability.o)
"_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
_OBJC_CLASS_$_PSMailViewController in PSMailViewController.o
objc-class-ref-to-MFMailComposeViewController in PSMailViewController.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[PSReachability startNotifier] in PinkelStar(Reachability.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
Thank you for your help!!
Tony
It looks like you are not linking all the needed Frameworks into your project. Please take a look at the Readme.mdown that lists all of the frameworks and include them into your project. That will resolve these issues.
Required frameworks may not be added to the project correctly or the path given for the framework in Framework search path may be incorrect.Verify.If you are not adding any private framework then leave Framework search path blank and then try.

compile error on Xcode

How can i fix it
Ld build/Debug-iphonesimulator/iRadio.app/iRadio normal i386
cd /Users/ragopor/Desktop/iRadio
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk -L/Users/ragopor/Desktop/iRadio/build/Debug-iphonesimulator -F/Users/ragopor/Desktop/iRadio/build/Debug-iphonesimulator -F/Users/ragopor/Desktop/iRadio -filelist /Users/ragopor/Desktop/iRadio/build/iRadio.build/Debug-iphonesimulator/iRadio.build/Objects-normal/i386/iRadio.LinkFileList -mmacosx-version-min=10.5 -framework MediaPlayer -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/ragopor/Desktop/iRadio/build/Debug-iphonesimulator/iRadio.app/iRadio
ld: warning: in /Users/ragopor/Desktop/iRadio/MediaPlayer.framework/MediaPlayer, missing required architecture i386 in file
Undefined symbols:
".objc_class_name_MPMoviePlayerController", referenced from:
literal-pointer#__OBJC#__cls_refs#MPMoviePlayerController in iRadioAppDelegate.o
"_MPMoviePlayerContentPreloadDidFinishNotification", referenced from:
_MPMoviePlayerContentPreloadDidFinishNotification$non_lazy_ptr in iRadioAppDelegate.o
"_MPMoviePlayerScalingModeDidChangeNotification", referenced from:
_MPMoviePlayerScalingModeDidChangeNotification$non_lazy_ptr in iRadioAppDelegate.o
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
_MPMoviePlayerPlaybackDidFinishNotification$non_lazy_ptr in iRadioAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Looks like you need to include the MediaFramework in your project.
I had the same issue while all frameworks and compiling sources were added. What fixed my issue was to delete ~/ProjectFolder/MediaPlayer.framework/MediaPlayer.exec file, and then build and run, and it worked!