2

I want to use core plot in my project to display bar&scatter plots.Before that I made a prototype project where I was successful in plotting those two. But when I tried to include it into my project faced some problems.

1) My project has a static library so according to the https://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications, I added coreplot-cocoatouch.xcodeproj added too as a static library to my project and i set linker flags -ObjC as well for my app project then compiler throws a Mac linker error "Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1"

2) If I did not include -ObjC it throws error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance "

I am not able to find where am I doing wrong.Is it the problem with ARC because my project doesnt use ARC but as per some forums, I found we can use non ARC and ARC libraries in a single workspace.

I tried with CorePlot versions 1.3 and 1.4 & using Xcode 4.5, are these two arc or not.

Any help is appreciated.

Thanks in Advance.

User-1070892
  • 929
  • 10
  • 16

2 Answers2

2

1 Possible reason may be that there are 2 different versions (duplicate) of Core-Plot Exists in your build directory.. or you have #import .m class instead of .h in your code.. sometimes same thing happens if you have 2 different classes with same name exists in your code.. Also do try cleaning your build directory and check again.

Dinesh
  • 929
  • 7
  • 25
1
  1. Use the Core Plot dependent project or the pre-built static library, not both.

  2. The -ObjC linker flag is required. You also need the -all_load linker flag. That error message means that one of the category methods added by Core Plot did not load at runtime; the -all_load flag tells the linker to make sure the app knows to load those methods, too.

Eric Skroch
  • 27,381
  • 3
  • 29
  • 36
  • I tried in both two ways but nothing worked, could you please let me know how could I do the linker to make sure the app knows to load those methods, too. – User-1070892 Nov 18 '13 at 07:03
  • Which way do you want to install it? Build from source with the dependent project or the pre-built static library? – Eric Skroch Nov 19 '13 at 01:26
  • My proj already have a static library so i tried in that way.any way is ok for me – User-1070892 Nov 19 '13 at 07:29
  • Make sure the Core Plot static library is marked "Required" in the Link Binaries With Libraries link phase. – Eric Skroch Nov 20 '13 at 02:02
  • I am Sure it is set to required, I checked. Problem is when I set other linker flags to -ObjC or -all_load throws "Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1" error, So I cant move further. – User-1070892 Nov 20 '13 at 07:27
  • What other libraries are you using? Sometimes `all_load` causes conflicts. – Eric Skroch Nov 20 '13 at 11:39
  • I have a static library created by me and it is non arc(both app and lib).Is that creating conflicts bcoz Core plot supports ARC – User-1070892 Nov 21 '13 at 06:55