1

I am facing duplicate symbols issue during use of Core plot API and ESRI map Arc GIS API. In my app I am using Core plot and ArcGIS API. To provide support for 64 bit device, I have download new API for ArcGI (ESRI map) and accordingly update CorePlot API for 64 bit. After making changes I am facing issue:

error description are here:

duplicate symbol _squareOfDistanceBetweenPoints in:
    /Users/xxxx/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTUtilities.o)
    /Users/xxxx/Desktop/18 Nov/SCM_iPad/SCM/CorePlot/coreplot_new.a(CPTUtilities.o)
duplicate symbol _niceNum in:
    /Users/xxxx/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTAxis.o)
    /Users/xxxx/Desktop/18 Nov/SCM_iPad/SCM/CorePlot/coreplot_new.a(CPTAxis.o)
duplicate symbol _CreateRoundedRectPath in:
    /Users/xxxx/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTPathExtensions.o)
    /Users/xxxx/Desktop/18 Nov/SCM_iPad/SCM/CorePlot/coreplot_new.a(CPTPathExtensions.o)
duplicate symbol _AddRoundedRectPath in:
    /Users/xxxx/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTPathExtensions.o)
    /Users/xxxx/Desktop/18 Nov/SCM_iPad/SCM/CorePlot/coreplot_new.a(CPTPathExtensions.o)
duplicate symbol _MyCGPathApplierFunc in:
    /Users/xxxx/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(NSCoderExtensions.o)
    /Users/xxxx/Desktop/18 Nov/SCM_iPad/SCM/CorePlot/coreplot_new.a(NSCoderExtensions.o)
ld: 5 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If anyone face issue please suggest. I am unable to figure out what is duplicate in those API Earlier these two working fine (OLD api without 64 bit support)

Rumin
  • 3,787
  • 3
  • 27
  • 30
iOS Test
  • 1,103
  • 1
  • 11
  • 18
  • There seem to be a number of functions (e.g. `CreateRoundedRectPath`) that exist in both frameworks. It's possible that one framework is contained within the other, meaning that you'd only need to include one of them. – Guy Kogus Nov 24 '14 at 12:33
  • This might help you: http://stackoverflow.com/questions/6660199/coreplot-for-implementing-barchart – Mrunal Nov 24 '14 at 12:33
  • search for the duplicate symbols (_squareOfDistanceBetweenPoints, _niceNum....) if they are implemented(i think these are methods) two times remove one of them.. – Ravi Nov 24 '14 at 12:36
  • Is there any way to remove from either any one of them library.. – iOS Test Nov 24 '14 at 12:46
  • It's unusual to get duplicate symbols from *libraries*. By default, the linker picks one and considers the dependency satisfied. Are you using any link flags to force loading of library symbols (-ObjC, -all_load...)? Also, have you tried building without coreplot? – Phillip Mills Nov 24 '14 at 13:23
  • I fixed the issue by renaming Coreplot library methods and recompile it and create new library and used it. – iOS Test Nov 26 '14 at 09:16

2 Answers2

8

You might have imported the .m instead of the .h file

Mike M
  • 4,879
  • 5
  • 38
  • 58
Keerthi Shekar
  • 176
  • 1
  • 8
0

You might have added any Typedef function in .H file and have imported .H in many classes.

In my case it was an issue,

ShadowASettings ShadowSettingsMake(CGSize shadowSize, CGFloat shadowOpacity, CGFloat shadowRadius){
    ShadowASettings settings;
    settings.shadowOffset = shadowSize;
    settings.shadowOpacity = shadowOpacity;
    settings.shadowRadius = shadowRadius;
    return settings;
}

I wrote this function in ABC.h and then I imported ANC.h in my HomeVC.h and XYZ.h So, then I simply move this function to .m of that class as it was only used in .m

Mrug
  • 4,963
  • 2
  • 31
  • 53