百度地图在某架构下找不到符号.a文件的问题
1.现象:
就是说找不到符号给i386的架构(就是模拟器)。或者找不到符号给arm架构(真机)。
ld: warning: ignoring file /Users/pufang/xcode/demo/baidumap/lib/libs/Release-iphoneos/libbaidumapapi.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_BMKMapManager", referenced from:
objc-class-ref in BaiduMapApiDemoAppDelegate.o
"_OBJC_METACLASS_$_BMKPointAnnotation", referenced from:
_OBJC_METACLASS_$_RouteAnnotation in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPointAnnotation", referenced from:
_OBJC_CLASS_$_RouteAnnotation in RouteSearchDemoViewController.o
objc-class-ref in AnnotationDemoViewController.o
objc-class-ref in GeocodeDemoViewController.o
objc-class-ref in PoiSearchDemoViewController.o
"_OBJC_CLASS_$_BMKSearch", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
objc-class-ref in GeocodeDemoViewController.o
objc-class-ref in PoiSearchDemoViewController.o
"_OBJC_CLASS_$_BMKAnnotationView", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPolyline", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPolylineView", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPlanNode", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPinAnnotationView", referenced from:
objc-class-ref in AnnotationDemoViewController.o
objc-class-ref in GeocodeDemoViewController.o
objc-class-ref in PoiSearchDemoViewController.o
"_OBJC_CLASS_$_BMKCircle", referenced from:
objc-class-ref in OverlayDemoViewController.o
"_OBJC_CLASS_$_BMKCircleView", referenced from:
objc-class-ref in OverlayDemoViewController.o
"_OBJC_CLASS_$_BMKOfflineMap", referenced from:
2.问题:
库搜索路径指定不对或者将arm和i386的库都包含了。
3.解决方法:
找到Library Search Paths部分,删除多余的路径或者添加合适的路径。
4.参考:
http://0.zhouguangwu.duapp.com/detail.php?id=674
吧上面那个删除了就搞定了
ld: warning: directory not found for option '-L/work/svn/mapsdk/iphone/baidumapapi/build/Release-iphonesos'
ld: warning: ignoring file /Users/pufang/xcode/demo/baidumap/lib/libs/Release-iphoneos/libbaidumapapi.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_BMKMapManager", referenced from:
objc-class-ref in BaiduMapApiDemoAppDelegate.o
"_OBJC_METACLASS_$_BMKPointAnnotation", referenced from:
_OBJC_METACLASS_$_RouteAnnotation in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPointAnnotation", referenced from:
_OBJC_CLASS_$_RouteAnnotation in RouteSearchDemoViewController.o
objc-class-ref in AnnotationDemoViewController.o
objc-class-ref in GeocodeDemoViewController.o
objc-class-ref in PoiSearchDemoViewController.o
"_OBJC_CLASS_$_BMKSearch", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
objc-class-ref in GeocodeDemoViewController.o
objc-class-ref in PoiSearchDemoViewController.o
"_OBJC_CLASS_$_BMKAnnotationView", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPolyline", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPolylineView", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPlanNode", referenced from:
objc-class-ref in RouteSearchDemoViewController.o
"_OBJC_CLASS_$_BMKPinAnnotationView", referenced from:
objc-class-ref in AnnotationDemoViewController.o
objc-class-ref in GeocodeDemoViewController.o
objc-class-ref in PoiSearchDemoViewController.o
"_OBJC_CLASS_$_BMKCircle", referenced from:
objc-class-ref in OverlayDemoViewController.o
"_OBJC_CLASS_$_BMKCircleView", referenced from:
objc-class-ref in OverlayDemoViewController.o
"_OBJC_CLASS_$_BMKOfflineMap", referenced from:
BMKMapManager *mapManager = [[BMKMapManager alloc]init];
[mapManager start:@"C45642BBD6852AEF5D3240C59F6C8CFE207AF843" generalDelegate:self];必须加上这行, 不然会一团黑