我正在尝试使用iphone sdk获取当前位置。这是代码:
这是构建错误:
使用配置“Release”构建项目“Send2iPhone”的目标“Send2iPhone” - (2个错误) 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 未定义的符号: “.objc_class_name_CLLocationManager”,引自: 在DetailViewController.o中的文字指针@__ OBJC @__ cls_refs @CLLocationManager “_kCLLocationAccuracyNearestTenMeters”,引自: _kCLLocationAccuracyNearestTenMeters DetailViewController.o中的$ non_lazy_ptr ld:找不到符号 collect2:ld返回1退出状态 “.objc_class_name_CLLocationManager”,引自: 在DetailViewController.o中的文字指针@__ OBJC @__ cls_refs @CLLocationManager “_kCLLocationAccuracyNearestTenMeters”,引自: _kCLLocationAccuracyNearestTenMeters DetailViewController.o中的$ non_lazy_ptr ld:找不到符号 collect2:ld返回1退出状态 构建失败(2个错误)
我很无能......任何想法?
答案 0 :(得分:2)
您是否已将CoreLocation库添加到项目中?看起来你的链接有问题,这通常意味着你没有项目所需的所有库。