Khwaab Dave Khwaab Dave - 3 months ago 29
iOS Question

iOS WeMo SDK Architecture issues

I'm trying to build an app that controls a WeMo Switch by Belkin. They released their own SDK's to control their product, and I have included them in my Library search paths and in my Linked Libraries and Frame works area.

First I try to compile for all architectures (including arm64) and get the following 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)


Next I try to disable arm64 assuming that the libraries are not 64bit (correct me if I'm wrong)

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)


No idea where to go from here, I suspect the library is out of date and not for armv7/7s (it wont build in i386 under the simulator either) but if anyone has had any luck with this or any ideas, anything is appreciated.

Answer

Here is the solution that I did to recover from this problem.

  • Include the Libraries provided in the folder -iphonesos into your project.
  • Add the following frameworks to Project.

    1. libxml2.dylib
    2. CFNetwork.framework
    3. MobileCoreServices.framework
    4. Security.framework
    5. SystemConfiguration.framework
    
  • Then go to your build settings & search for architectures.

  • Add a new value by clicking other... & add this $(ARCHS_STANDARD_32_BIT)

  • In case you can also choose, $(ARCHS_STANDARD) means Standard architectures (armv7, armv7s)

  • Build the projects, you will get rid of all the linker errors.