架构 i386 的未定义符号 iOS

Undefined symbols for architecture i386 iOS

我在尝试使用 iOS 图表库 运行 我的项目时发现以下错误。当 iPhone5 和 iPad2 上的 运行 时,代码在模拟器上运行良好,但 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)

我已经解决了这个问题。我将 arm64 包含在有效架构中。问题是我试图将这个库集成到已经存在的 objective c 项目中。早些时候使用的是核心情节。所以核心绘图文件造成了问题。如果当时包含核心绘图文件,我无法将 arm64 包含在有效架构中,因为它在 iPhone6 上崩溃了。所以我只是删除了核心绘图文件,一切都开始顺利进行。