2014-02-15 218 views
1

我正嘗試構建一個應用程序,該應用程序通過Belkin控制WeMo開關。他們發佈了自己的SDK來控制他們的產品,並且將它們包含在我的庫搜索路徑以及鏈接的庫和框架工作區中。iOS WeMo 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位(如果糾正我,我「M錯)

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無論是),但如果任何人有任何這個或任何想法的運氣,任何感激。

回答

6

這是我從這個問題中恢復的解決方案。

  • 將文件夾-iphonesos中提供的庫包含到項目中。
  • 將以下框架添加到項目。

    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)

  • 構建項目,你將擺脫所有的連接器的錯誤。
+0

你救了我的職業生涯:) – lucaslt89

+0

問題是,arm64很快就會被強制要求 – dwery

+0

這真的令人沮喪,我做了同樣的事情,但它對我沒有任何作用。有沒有人嘗試在xcode9中構建它? –

0

enter image description hereenter image description here

使用此部分顯示儘管ARMv7的或$(ARCHS_STANDARD_32_BIT)解決方案的錯誤?

1

這是爲了幫助,即使它仍然不符合@ Balram的答案。 您必須在目標的構建設置中的鏈接部分下的「其他鏈接器標誌」屬性中添加-lxml2。 這對我有效