Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange error in Apple Core Data tutorial

I was doing the Apple Core Data Tutorial, and on the first occasion I was suggested to build the project, I got this error:

Ld /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator/Locations.app/Locations normal i386
    cd "/Users/user/Documents/xcode projects/Locations"
    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/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Intermediates/Locations.build/Debug-iphonesimulator/Locations.build/Objects-normal/i386/Locations.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator/Locations.app/Locations

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CLLocationManager", referenced from:
      objc-class-ref in RootViewController.o
  "_kCLLocationAccuracyNearestTenMeters", referenced from:
      -[RootViewController locationManager] in RootViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

I use XCode 4.0.2, Mac OS X 10.6.8. What can be the cause of this? I followed the tutorial step-by-step and have absolutely no idea what could go wrong.

like image 581
Max Yankov Avatar asked Dec 13 '22 11:12

Max Yankov


2 Answers

You need to import the CoreLocation framework. This can be done by going to the Project - Build Phases - Link Binary with Libraries

like image 132
Kal Avatar answered Feb 10 '23 16:02

Kal


Looks like you need to add the CoreLocation framework to the linked frameworks of the project.

In the project settings, select the application target and under "Build Phases" add it to the "Link Binary With Libraries" step.

like image 21
Caffeine Avatar answered Feb 10 '23 16:02

Caffeine