我正在尝试构建一个控制 Belkin 的 WeMo Switch 的应用程序。他们发布了自己的 SDK 来控制他们的产品,我已将它们包含在我的库搜索路径以及我的链接库和框架工作区中。
首先,我尝试为所有架构(包括 arm64)进行编译并得到以下 Mach-O Linker Error
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 中构建)但是如果有人对此或任何想法有任何运气,任何事情都将不胜感激。
最佳答案
这是我从这个问题中恢复的解决方案。
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)
关于iOS WeMo SDK 架构问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21792893/