架构i386 iOS的未定义符号

时间:2016-03-07 07:05:31

标签: ios objective-c swift ios-charts bridging-header

我在尝试使用iOS图表库运行项目时发现以下错误。在iPhone5和iPad2上运行时,代码在Simulator上运行正常但iPhone6及更高版本的构建失败:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$__TtC6Charts12BarChartData", referenced from:
      objc-class-ref in SMWBarChartsViewController.o
      objc-class-ref in SMWBarGraphViewController.o
  "_OBJC_CLASS_$__TtC6Charts12PieChartData", referenced from:
      objc-class-ref in SMWPieChartsViewController.o
  "_OBJC_CLASS_$__TtC6Charts15BarChartDataSet", referenced from:
      objc-class-ref in SMWBarChartsViewController.o
      objc-class-ref in SMWBarGraphViewController.o
  "_OBJC_CLASS_$__TtC6Charts15PieChartDataSet", referenced from:
      objc-class-ref in SMWPieChartsViewController.o
  "_OBJC_CLASS_$__TtC6Charts17BarChartDataEntry", referenced from:
      objc-class-ref in SMWBarChartsViewController.o
      objc-class-ref in SMWPieChartsViewController.o
      objc-class-ref in SMWBarGraphViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:1)

我能够解决这个问题。我在有效的架构中包含了arm64。问题是我试图将这个库集成到已经存在的目标c项目中。早先是使用核心情节。所以核心情节文件正在创造问题。如果包含核心绘图文件,那么我无法将arm64包含在有效的体系结构中,因为它在iPhone6上崩溃了。所以我刚刚删除了核心情节文件,一切都开始顺利进行。