Reputation: 12051
So basically I have two libraries that are I think conflicting with each other. I have the following settings for the key "Library Search path":
"$(SRCROOT)/projectname/Release-iphone/lib"
for one of my libraries, and "$(SRCROOT)/projectname"
for another.
I have added a CorePlot
library into my project but to work it requires the following Linker Flags: -ObjC -all_load
.
Now when I add one or both of them I get the following message and my project won't build:
duplicate symbol _OBJC_CLASS_$_GTMHTTPFetcher in:
/Users/user/Library/Developer/Xcode/DerivedData/projectname-chibchblpntaapfagqcohtkixhib/Build/Intermediates/projectname.build/Debug-iphoneos/projectname.build/Objects-normal/armv7/GTMHTTPFetcher.o
/Users/user/Dropbox/Projectname/projectname/projectname/libGTLTouchStaticLib.a(GTMHTTPFetcher.o)
duplicate symbol _OBJC_METACLASS_$_GTMHTTPFetcher in:
/Users/user/Library/Developer/Xcode/DerivedData/projectname-chibchblpntaapfagqcohtkixhib/Build/Intermediates/projectname.build/Debug-iphoneos/projectname.build/Objects-normal/armv7/GTMHTTPFetcher.o
/Users/user/Dropbox/Projectname/projectname/projectname/libGTLTouchStaticLib.a(GTMHTTPFetcher.o)
ld: 176 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The problem turns out to be with the Google API library libGTLTouchStaticLib.a
but I don't get how do linker flags influence it.
Upvotes: 3
Views: 409
Reputation: 50129
screw -all_load that was a hack to load categories. should work without it
Upvotes: 0
Reputation: 31026
It looks as though you have the source file included directly into your project as well as having a link to the library. You should choose one or the other (probably the library).
Upvotes: 2