【问题标题】:Undefined symbols for architecture i386 iOS体系结构 i386 iOS 的未定义符号
【发布时间】:2016-03-07 07:05:30
【问题描述】:

我在尝试使用 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)

【问题讨论】:

  • 我看过这个链接。它对我没有帮助。我在此链接上尝试了所有方法,但没有任何效果。
  • @NikhilGupta:你能检查一下相应的 .m 文件是否已添加到目标“构建阶段”的“编译源”中。通常,它会被添加,但如果它不存在,请尝试添加它们,然后清理并构建。
  • @neha_sinha19 :他们已经在那里了。我删除了它们并再次添加它们,但仍然出现错误。但如果这是问题所在,那为什么代码会在 iPhone5 和 iPad2 上运行?
  • @NikhilGupta:图书馆是什么?如果你提供一个链接,我可以查看它,看看是什么导致了错误。

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多