我正在尝试使用Belkin构建一个控制WeMo Switch的应用程序。他们发布了自己的SDK来控制他们的产品,我已将它们包含在我的图书馆搜索路径和我的链接库和框架工作区中。
首先我尝试编译所有架构(包括arm64)并获得以下Mach-O链接器错误
ld: warning: ignoring file /Users/khwaab/src/enimai/iOS/House Control/-
iphoneos/BelkinSDKLibrary.a, missing required architecture arm64 in file
/Users/khwaab/src/enimai/iOS/House Control/-iphoneos/BelkinSDKLibrary.a (3 slices)
ld: warning: ignoring file /Users/khwaab/src/enimai/iOS/House Control/-
iphoneos/WeMoLocalControl.a, missing required architecture arm64 in file
/Users/khwaab/src/enimai/iOS/House Control/-iphoneos/WeMoLocalControl.a (3 slices)
ld: warning: ignoring file /Users/khwaab/src/enimai/iOS/House Control/-
iphoneos/Cybergarage.a, missing required architecture arm64 in file
/Users/khwaab/src/enimai/iOS/House Control/-iphoneos/Cybergarage.a (3 slices)
ld: warning: ignoring file /Users/khwaab/src/enimai/iOS/House Control/-
iphoneos/Reachability.a, missing required architecture arm64 in file
/Users/khwaab/src/enimai/iOS/House Control/-iphoneos/Reachability.a (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_WeMoDiscoveryManager", referenced from:
objc-class-ref in LightControlViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
接下来我尝试禁用arm64,假设库不是64位(如果我错了,请纠正我)
Undefined symbols for architecture armv7s:
"_xmlGetPredefinedEntity", referenced from:
_cg_libxml2_get_entity in Cybergarage.a(cxml_parser_libxml2.o)
"_xmlCreateMemoryParserCtxt", referenced from:
_cg_libxml2_parsewrapper in Cybergarage.a(cxml_parser_libxml2.o)
"_CNCopyCurrentNetworkInfo", referenced from:
+[NetworkUtilities getCurrentWifiAccessPointName] in
BelkinSDKLibrary.a(NetworkUtilities.o)
"_xmlFreeDoc", referenced from:
_cg_libxml2_parsewrapper in Cybergarage.a(cxml_parser_libxml2.o)
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.a(Reachability.o)
"_xmlFreeParserCtxt", referenced from:
_cg_libxml2_parsewrapper in Cybergarage.a(cxml_parser_libxml2.o)
"_xmlParseDocument", referenced from:
_cg_libxml2_parsewrapper in Cybergarage.a(cxml_parser_libxml2.o)
"_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
-[Reachability stopNotifier] in Reachability.a(Reachability.o)
"_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
-[Reachability startNotifier] in Reachability.a(Reachability.o)
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.a(Reachability.o)
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability description] in Reachability.a(Reachability.o)
-[Reachability currentReachabilityStatus] in Reachability.a(Reachability.o)
-[Reachability isReachable] in Reachability.a(Reachability.o)
-[Reachability isConnectionRequired] in Reachability.a(Reachability.o)
-[Reachability isConnectionOnDemand] in Reachability.a(Reachability.o)
-[Reachability isInterventionRequired] in Reachability.a(Reachability.o)
-[Reachability isReachableViaWWAN] in Reachability.a(Reachability.o)
...
"_CNCopySupportedInterfaces", referenced from:
+[NetworkUtilities getCurrentWifiAccessPointName] in
BelkinSDKLibrary.a(NetworkUtilities.o)
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostName:] in Reachability.a(Reachability.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
不知道从哪里开始,我怀疑这个库是过时的而不是armv7 / 7s(它也不会在模拟器下的i386中构建)但是如果有人对这个或任何想法有任何好运,那么任何东西非常感谢。
答案 0 :(得分:6)
这是我从这个问题中恢复的解决方案。
将以下框架添加到Project。
1. libxml2.dylib
2. CFNetwork.framework
3. MobileCoreServices.framework
4. Security.framework
5. SystemConfiguration.framework
然后转到您的构建设置&寻找架构。
点击其他内容添加新值...&添加此$(ARCHS_STANDARD_32_BIT)
如果您也可以选择,$(ARCHS_STANDARD)
表示Standard architectures (armv7, armv7s)
答案 1 :(得分:1)
答案 2 :(得分:0)