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…
- dyld`gdb_image_notifier exception when i run my application in device
- Xcode 5 crash when Open storyboard made from Xcode 4.6
- How to Delete Derived Data and Clean Project in Xcode 5 and Xcode 6?
- iPhone 4" screen with xcassets not pulling correct image
- Invalid context 0x0 on UITextField (Xcode 5)
- How to suppress a “SpriteKit Texture Atlas Generator Warning”?
9 Solutions Collect From Internet About “missing required architecture x86_64 in file libCorePlot-CocoaTouch.a”
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.
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.
lipo -info libCorePlot-CocoaTouch.a
It’s showing that the library is built for armv7, armv7s and i386 (32bit simulator) and that’s not including the 64bit simulator. You’ll have to build the lib for 64bit simulator and after that you can use lipo to add the 64bit lib to libCorePlot-CocoaTouch.a.
Architectures in the fat file: libCorePlot-CocoaTouch.a are: armv7 armv7s i386
PS: It’s not going to work on iPhone 5S as well (no arm64).
Here are the steps you need to make in order to produce a binary that has both the arm64 and x86_64 architectures in it:
- download CorePlot_1.4 from https://code.google.com/p/core-plot/downloads/detail?name=CorePlot_1.4.zip&can=2&q=
- Open the Xcode project (CorePlot-CocoaTouch.xcodeproj) located in CorePlot_1.4/Source/framework
- Select “Standard architectures” for “architectures” and “Latest iOS (iOS 7)” for “Base SDK”
- Build the library (CMD+B)
- Go to CorePlot_1.4/Source/build/ in the terminal
- Run lipo -create ./Debug-iphoneos/libCorePlot-CocoaTouch.a ./Debug-iphonesimulator/libCorePlot-CocoaTouch.a -output core_plot_all.a
- Add the newly created lib (core_plot_all.a) to your project
- You’re ready to go
CorePlot has released 1.5.1 to work with Xcode 5.1. You only need to copy the CorePlotHeaders folder and the libCorePlot-CocoaTouch.a file to your project.
You can download it from here.
change the setting of Architecture of Xcode
If you don’t want to go through the process of downloading and building the project, I built the universal library (for armv7, armv7s and arm64) and put it up here.
This is built from coreplot commit id cc0a18cef8915f4a11e0699e9429c0a2f0018b42.
I followed the official document ‘Using Core Plot In An Application’ in Xcode 7.2.1 with iOS SDK 9.2.
I got the same error even if the .a supported arm64, until I add the linker flag ‘-lCorePlot-CocoaTouch’ in addition to ‘-OjbC’.
If you tried all above but still not work, try to set -ObjC -lCorePlot-CocoaTouch to ‘Other Linker Flags’ in ‘Build Settings’ or your project target.
Simplest Solution that works for me: Go to your project > build setting > architecture. Change architecture as armv7 and delete others like armv6,etc like as given in the image below :-
I got same errors with Xcode7.3 + CocoaPod. And I fixed the issue with Other Linker Flags= $(inherited) .
Of course, this setting is only valid with CocoaPod.
- How to add a border inside a uiview?
- cellForRowAtIndexPath: not called
- How can I create a count down timer for cocos2d?
- Center custom UIView vertically and horizontally using Auto Layout
- Swift: Providing a default protocol implementation in a protocol extension
- : unrecognized selector sent to instance 0x6d21350
- Swift: how to set the iphone volume programmatically
- “EXC_BAD_ACCESS: Unable to restore previously selected frame” Error, Array size?
- How do I correct the fact that my .h file is linking its IBOutlets to a XIB file from another project?
- Can i able to support multiple inheritance with protocol in swift?
- UIActivityIndicatorView not displaying in UIAlertView – iOS7
- How to create multiple windows with the same nib file in xcode
- RxSwift: onDisposed activated before Alamofire return data
- Creating custom UITextView with UILabels as well as text in it
- Objective-C: Calling selectors with multiple arguments