我正在尝试构建一个控制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中构建)但是如果有人对这个或任何想法有任何好运,那么任何事情都会受到赞赏.
这是我从这个问题中恢复的解决方案.
将以下框架添加到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)
| 归档时间: | 
 | 
| 查看次数: | 949 次 | 
| 最近记录: |