ios中的Coreplot构建失败问题

Posted

技术标签:

【中文标题】ios中的Coreplot构建失败问题【英文标题】:Coreplot build failed issue in ios 【发布时间】:2014-10-28 07:51:28 【问题描述】:

在使用核心绘图库构建应用程序时,我面临以下问题。 它在2天前工作。但它突然停止运行。

libCorePlot-CocoaTouch.a (2 slices)
Undefined symbols for architecture x86_64:
  "_CPTDecimalFromFloat", referenced from:
      -[GraphView generateLayout] in GraphView.o
  "_CPTDecimalFromInt", referenced from:
      -[GraphView generateLayout] in GraphView.o
  "_OBJC_CLASS_$_CPTAxisLabel", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTBarPlot", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTColor", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTConstraints", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTFill", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTGraphHostingView", referenced from:
      _OBJC_CLASS_$_GraphView in GraphView.o
  "_OBJC_CLASS_$_CPTMutableLineStyle", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTMutableTextStyle", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTPlotRange", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_CLASS_$_CPTXYGraph", referenced from:
      objc-class-ref in GraphView.o
  "_OBJC_METACLASS_$_CPTGraphHostingView", referenced from:
      _OBJC_METACLASS_$_GraphView in GraphView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

我想你会在这个答案中找到解决方案:***.com/a/20266141/4177109 @Ckouta 感谢您的快速回复。我提到了那个链接,它没有解决我的问题。 【参考方案1】:

为您的项目添加新的核心绘图库框架。删除旧库。这些是要遵循的步骤

    下载核心绘图库。 打开 xcode CorePlot-CocoaTouch.xcodeproj 进入项目并点击构建 现在转到您的 mac 中的核心绘图框架文件夹。您可以在其中看到 build 文件夹。 现在打开终端并提供您的核心绘图路径 cd CorePlot_1.4/Source/build/ 类型 lipo -create ./Debug-iphoneos/libCorePlot-CocoaTouch.a ./Debug-iphonesimulator/libCorePlot-CocoaTouch.a -output core_plot_all.a 已创建新库,现在将此库和核心头文件添加到您的项目中。 现在构建您的项目。

然后将 -ObjC 添加到其他链接器标志

【讨论】:

以上是关于ios中的Coreplot构建失败问题的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Cocoa Pods 中启用“CorePlot”命令?

CorePlot 中的缩放轴

如何使用 iphone sdk 中的 corePlot 库将 CPTAxisLabel 包装成两行?

iOS导入CorePlot用于绘制饼图

CorePlot 在 iOS7 应用程序/Xcode5 中抛出异常

IOS CorePlot禁用垂直滚动