缺少文件libCorePlot-CocoaTouch.a中所需的体系结构x86_64

Erz*_*iel 19 iphone xcode core-plot ios xcode5

根据Ray Wenderlich教程,我做了以下工作:

第1步 -我在官方网站上下载了 CorePlot_1.4.zip

第2步 -我在我的项目中添加了 CorePlotHeaders文件夹名为libCorePlot-CocoaTouch.a静态库(选中 "将项目复制到目标组的文件夹(如果需要)")

第3步 -我将以下内容添加到 Other Linker Flags字段中: -ObjC

第4步 -如果 libCorePlot-CocoaTouch.a QuartzCore框架在这里,我检查了 Link Binary和Libraries

结果:当我编译我的项目时,它在我使用 Iphone Retina(4英寸)时工作正常.但是当我使用 Iphone Retina(4英寸64位) 时,我在尝试构建和运行时收到以下消息:

ld: warning: ignoring file /blah/blah/libCorePlot-CocoaTouch.a, missing required architecture x86_64 in file /blah/blah/libCorePlot-CocoaTouch.a (3 slices)

这里有完整的信息:

ld: warning: ignoring file /Users/me/Desktop/project/libCorePlot-CocoaTouch.a, missing required architecture x86_64 in file /Users/me/Desktop/project/libCorePlot-CocoaTouch.a (3 slices)
Undefined symbols for architecture x86_64:
"_CPTDecimalFromCGFloat", referenced from:
  -[PatientConstanteVisualiser configurePlots] in PatientConstanteVisualiser.o
  -[PatientConstanteVisualiser configureAxes] in PatientConstanteVisualiser.o
"_CPTDecimalFromInteger", referenced from:
  -[PatientConstanteVisualiser configureAxes] in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTAxisLabel", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTColor", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTFill", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTMutableLineStyle", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTMutableTextStyle", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTPlotSymbol", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTScatterPlot", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTTheme", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_OBJC_CLASS_$_CPTXYGraph", referenced from:
  objc-class-ref in PatientConstanteVisualiser.o
"_kCPTStocksTheme", referenced from:
  -[PatientConstanteVisualiser configureGraph] in PatientConstanteVisualiser.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

我在这个问题上花了几个小时...请帮忙......

Eri*_*och 19

如果您需要64位版本的Core Plot,则必须构建新版本的静态库.Arm64版本需要iOS 7,但Core Plot也支持早期版本,因此预构建的库仅为32位.

打开CorePlot-CocoaTouch.xcodeproj并将体系结构设置更改为"标准体系结构(包括64位)".构建"通用库"目标并包含生成的静态库来代替Core Plot 1.4附带的静态库,或者使用依赖项目设置.


小智 14

CorePlot发布了1.5.1以使用Xcode 5.1.您只需要将CorePlotHeaders文件夹和libCorePlot-CocoaTouch.a文件复制到项目中.

你可以从这里下载.


Iva*_*hev 13

尝试:

lipo -info libCorePlot-CocoaTouch.a
Run Code Online (Sandbox Code Playgroud)

它显示该库是为armv7,armv7s和i386(32位模拟器)而构建的,并且不包括64位模拟器.你必须为64位模拟器构建lib,之后你可以使用lipo将64位lib添加到libCorePlot-CocoaTouch.a.

输出:

Architectures in the fat file: libCorePlot-CocoaTouch.a are: armv7 armv7s i386
Run Code Online (Sandbox Code Playgroud)

PS:它也无法在iPhone 5S上运行(没有arm64).

编辑:

以下是为了生成包含arm64和x86_64体系结构的二进制文件而需要执行的步骤:

  1. https://code.google.com/p/core-plot/downloads/detail?name=CorePlot_1.4.zip&can=2&q=下载CorePlot_1.4
  2. 打开位于CorePlot_1.4/Source/framework中的Xcode项目(CorePlot-CocoaTouch.xcodeproj)
  3. 选择"架构"的"标准架构"和"基础SDK"的"最新iOS(iOS 7)"
  4. 建立图书馆(CMD + B)
  5. 转到终端中的CorePlot_1.4/Source/build /
  6. 运行lipo -create ./Debug-iphoneos/libCorePlot-CocoaTouch.a ./Debug-iphonesimulator/libCorePlot-CocoaTouch.a -output core_plot_all.a
  7. 将新创建的lib(core_plot_all.a)添加到项目中
  8. 你准备好了


cod*_*cat 6

改变Xcode架构的设置

在此输入图像描述


Jam*_*ong 5

如果您不想完成下载和构建项目的过程,我构建了通用库(用于armv7,armv7s和arm64)并将其放在此处.

这是根据coreplot commit id cc0a18cef8915f4a11e0699e9429c0a2f0018b42构建的.