Erzékiel Erzékiel - 6 months ago 138
iOS Question

missing required architecture x86_64 in file libCorePlot-CocoaTouch.a

According to the Ray Wenderlich tutorial, I done the following :

Step 1 - I downloaded CorePlot_1.4.zip on the official website

Step 2 - I added to my project the CorePlotHeaders folder and the static library named libCorePlot-CocoaTouch.a (checking “Copy items into destination group’s folder (if needed)”)

Step 3 - I added into Other Linker Flags field the following : -ObjC

Step 4 - I checked into Link Binary with Libraries if libCorePlot-CocoaTouch.a and QuartzCore frameworks were here

Result : When I compile my project, it works fine when I'm using Iphone Retina (4-Inch). But when I'm using Iphone Retina (4-Inch 64-bit)
I got the following message when I try to build and run :

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


Here the complete message :

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)


I spent several hours on this issue... Please help...

Answer

If you want a 64-bit version of Core Plot, you'll have to build a new version of the static library. Arm64 builds require iOS 7 but Core Plot supports earlier versions, too, so the pre-built library is 32-bit only.

Open CorePlot-CocoaTouch.xcodeproj and change the architecture settings to "Standard Architectures (including 64-bit)". Either build the "Universal Library" target and include the resulting static library in place of the one included with Core Plot 1.4 or use the dependent project setup instead.