我正在使用Chilkat并在安装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)
我在网上找到了解决方案:
Add “-lresolv” to your list of link libraries.
当我搜索它时找不到-lresolv
,但我找到了libresolv.9.dylib
所以我添加了它,现在我收到了一个新错误:
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)
还有其他人有这个问题吗?我该如何解决这个问题?
我认为错误与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)
为什么一直说iphone?我正在构建一个ipad应用程序
这是我的Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'
答案 0 :(得分:8)
这里的问题可能是您将AFNetworking库链接两次,一次直接在您的项目上,再次通过Cocoapods。查看主项目文件的构建阶段。确保您只链接libPods而不是AFNetworking或通过Cocoapods使用的任何其他lib。这应该在链接中修复重复的符号。