Question

I'm creating a project with Core-Plot lib. I add the lib with static way. How can I run my app in 32 + 64 bit devices?

if I run lipo libCorePlot-CocoaTouch.a -info console response:

Architectures in the fat file: libCorePlot-CocoaTouch.a are: armv7 armv7s arm64

But this library works only with 32bit devices/simulator with 64bit simulator give me this error:

ld: warning: ignoring file PATH/libCorePlot-CocoaTouch.a, missing required architecture i386 in file PATH/libCorePlot-CocoaTouch.a (3 slices) Undefined symbols for architecture i386: "_CPTDecimalFromCGFloat", referenced from: -[HomeViewController configureSecondPlots] in HomeViewController.o -[HomeViewController configureSecondAxes] in HomeViewController.o "_CPTDecimalFromInteger", referenced from: -[HomeViewController configureSecondAxes] in HomeViewController.o "_OBJC_CLASS_$_CPTAxisLabel", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTColor", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTFill", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTGraphHostingView", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTMutableLineStyle", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTMutableTextStyle", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTPieChart", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTPlotSymbol", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTScatterPlot", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTTextLayer", referenced from: objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_CPTXYGraph", referenced from: objc-class-ref in HomeViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can I fix this problem?

Thank you

Was it helpful?

Solution

Combine both libraries and make a universal binary

lipo -create <simulator_lib>.a <device_lib>.a -output lib.a

OTHER TIPS

Open the Core Plot iOS project (CorePlot-CocoaTouch.xcodeproj), update the architecture build settings to include 64-bit, and build the "Universal Library" target. This will create a folder called "Release-universal" in your build folder containing a universal library with all architectures (device and simulator) and copies of all of the header files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top