I’m trying to get the current location using the iphone sdk. Here is the code:
here is the error on build:
Building target “Send2iPhone” of project “Send2iPhone” with configuration “Release” — (2 errors)
cd /Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone
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.sdk -L/Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Release-iphonesimulator -F/Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Release-iphonesimulator -filelist /Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Send2iPhone.build/Release-iphonesimulator/Send2iPhone.build/Objects-normal/i386/Send2iPhone.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Release-iphonesimulator/Send2iPhone.app/Send2iPhone
Undefined symbols:
“.objc_class_name_CLLocationManager”, referenced from:
literal-pointer@__OBJC@__cls_refs@CLLocationManager in DetailViewController.o
“_kCLLocationAccuracyNearestTenMeters”, referenced from:
_kCLLocationAccuracyNearestTenMeters$non_lazy_ptr in DetailViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
“.objc_class_name_CLLocationManager”, referenced from:
literal-pointer@__OBJC@__cls_refs@CLLocationManager in DetailViewController.o
“_kCLLocationAccuracyNearestTenMeters”, referenced from:
_kCLLocationAccuracyNearestTenMeters$non_lazy_ptr in DetailViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (2 errors)
I’m clueless…. any ideas?
Have you added the CoreLocation library to your project? Looks like your having problems linking, which usually means you don’t have all the libraries your project needs.