Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

duplicate symbol _OBJC_IVAR_$_AFHTTPRequestOperation._responseSerializer in

I am using Chilkat and got these errors after installing AFNetworking:

Undefined symbols for architecture armv7:
  "_res_9_query", referenced from:
      ChilkatResolve::bestMxLookup(char const*, StringBuffer&, LogBase&, bool) in libchilkatIos.a(ChilkatResolve.o)
      ChilkatResolve::dkimLookup(char const*, StringBuffer&, LogBase&, bool) in libchilkatIos.a(ChilkatResolve.o)
      ChilkatResolve::mxLookup(char const*, ScoredStrings&, LogBase&, bool) in libchilkatIos.a(ChilkatResolve.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have found solutions online:

Add “-lresolv” to your list of link libraries.

I could not find -lresolv when I searched for it but I did find libresolv.9.dylib so I added that and now I get a new error:

Apple Mach-O Linker Error


206 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

has anyone else had this problem? how would I go about fixing this?

I think the error has something to do with AFNetworking:

duplicate symbol _OBJC_IVAR_$_AFHTTPRequestOperation._responseSerializer in:
    /Users/jsuske/Library/Developer/Xcode/DerivedData/SchedulingiPadApplication-dumroeauljdomkhdnvscdxjvlqke/Build/Intermediates/SchedulingiPadApplication.build/Debug-iphoneos/SchedulingiPadApplication.build/Objects-normal/armv7/AFHTTPRequestOperation.o
    /Users/jsuske/Library/Developer/Xcode/DerivedData/SchedulingiPadApplication-dumroeauljdomkhdnvscdxjvlqke/Build/Products/Debug-iphoneos/libPods-AFNetworking.a(AFHTTPRequestOperation.o)
duplicate symbol _OBJC_IVAR_$_AFHTTPRequestOperation._responseObject in:
    /Users/jsuske/Library/Developer/Xcode/DerivedData/SchedulingiPadApplication-dumroeauljdomkhdnvscdxjvlqke/Build/Intermediates/SchedulingiPadApplication.build/Debug-iphoneos/SchedulingiPadApplication.build/Objects-normal/armv7/AFHTTPRequestOperation.o

duplicate symbol _AFNetworkingReachabilityNotificationStatusItem in:
    /Users/jsuske/Library/Developer/Xcode/DerivedData/SchedulingiPadApplication-dumroeauljdomkhdnvscdxjvlqke/Build/Intermediates/SchedulingiPadApplication.build/Debug-iphoneos/SchedulingiPadApplication.build/Objects-normal/armv7/AFNetworkReachabilityManager.o
    /Users/jsuske/Library/Developer/Xcode/DerivedData/SchedulingiPadApplication-dumroeauljdomkhdnvscdxjvlqke/Build/Products/Debug-iphoneos/libPods-AFNetworking.a(AFNetworkReachabilityManager.o)

why does it keep saying iphone? I am building an ipad app

here is my Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'
like image 414
user979331 Avatar asked Apr 07 '15 16:04

user979331


1 Answers

The problem here is likely that you are linking the AFNetworking library twice, once directly on your project and again via Cocoapods. Look in the build phases of your main project file. Make sure you are only linking against libPods and not AFNetworking or any other lib that are are using via Cocoapods. This should fix your duplicate symbols in linking.

like image 120
Patrick Goley Avatar answered Nov 15 '22 03:11

Patrick Goley