ld:警告:忽略文件/ Users / a / Desktop / a

时间:2012-08-02 16:03:07

标签: iphone

在构建使用Core Plot框架的应用程序时,我看到以下链接器错误:

ld: warning: ignoring file /Users/a/Desktop/a
7-31-12 10.57 AM/usr/local/lib/libCorePlot-CocoaTouch.a, missing
required architecture i386 in file
/Users/a/Desktop/a 7-31-12 10.57
AM/usr/local/lib/libCorePlot-CocoaTouch.a (2 slices) Undefined symbols
for architecture i386:   "_CPTDecimalFromFloat", referenced from:
       -[CPTTestAppScatterPlotController viewDidLoad] in CPTTestAppScatterPlotController.o
       -[CPTTestAppScatterPlotController changePlotRange] in CPTTestAppScatterPlotController.o
       -[StatsVC CallBarChart] in StatsVC.o   "_CPTDecimalFromInt", referenced from:
       -[StatsVC CallBarChart] in StatsVC.o
       -[StatsVC CallScatterChart] in StatsVC.o   "_CPTDecimalFromString", referenced from:
       -[CPTTestAppScatterPlotController viewDidLoad] in CPTTestAppScatterPlotController.o
       -[StatsVC CallBarChart] in StatsVC.o
       -[StatsVC CallScatterChart] in StatsVC.o   "_OBJC_CLASS_$_CPTAxisLabel", referenced from:
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTBarPlot", referenced from:
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTColor", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTConstraints", referenced from:
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTFill", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTGradient", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTGraphHostingView", referenced from:
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTMutableLineStyle", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTPlotRange", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTPlotSymbol", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o   "_OBJC_CLASS_$_CPTScatterPlot", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTTextStyle", referenced from:
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTTheme", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_OBJC_CLASS_$_CPTXYGraph", referenced from:
       objc-class-ref in CPTTestAppScatterPlotController.o
       objc-class-ref in StatsVC.o   "_kCPTDarkGradientTheme", referenced from:
       -[CPTTestAppScatterPlotController viewDidLoad] in CPTTestAppScatterPlotController.o
       -[StatsVC CallScatterChart] in StatsVC.o
       -[CPTTestAppScatterPlotController viewDidLoad] in CPTTestAppScatterPlotController.o
       -[StatsVC CallScatterChart] in StatsVC.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit
 code 1 (use -v to see invocation)

我尝试正确连接coreplot,将架构更改为armv6,armv7等......但是从3天开始就遇到了这个问题

有什么建议吗?

3 个答案:

答案 0 :(得分:2)

看起来Coreplot已经构建为在设备上运行(即arm6 / 7架构),你正在尝试为i386编译,可能是模拟器?尝试为i386编译Coreplot。

对于/ Users / a / Desktop / a问题,或许您在链接阶段错误地包含了该文件?进入项目设置,然后“构建阶段”,最后查看“使用库链接二进制文件”。

答案 1 :(得分:1)

我遇到同样的问题,这就是我解决的问题。

第1步。          右键单击您的文件夹 - >将文件添加到“ProjectName” - >          确保选择将文件复制到同一个项目中。

步骤2.现在转到目标 - >构建阶段 - >链接二进制文件库             在这里,您将看到为该特定第三方库添加的二进制文件,例如             对于CorePlot libCorePlot-CocoaTouch.a但它通常没有正确链接             您使用(将文件添加到“您的ProjectName”)时复制到同一目录中但是这些             未正确链接,因此通过选择并使用( - )符号将其删除。现在使用(+)             符号再次添加二进制,例如在CorePlot的情况下使用
            libCorePlot-CocoaTouch.a

所以建立你的项目,你就完成了。就我而言,这有助于我解决我的问题。

但是由于64位和32位架构总会出现问题,您可以在文档apple documentation on settings related to 64/32 bit

中进行学习。

答案 2 :(得分:0)

我用这种方式解决了问题:

Xcode 4.6

首先

TARGETS>构建阶段>目标依赖项:添加“CorePlot-CocoaTouch”

第二

使用库链接二进制文件:添加“libCorePlot-CocoaTouch.a”