Wiingaard
Wiingaard

Reputation: 4302

Configuring the Hue SDK in Xcode

I'm trying to use the Hue SDK for iOS (iOS deployment target: 9.3) in swift. I've downloaded the source from github and followed the instructions..

  1. Created a new iOS application in Xcode (Version 7.3.1)
  2. Dragged the framework (HueSDK_iOS.framework) into the project
  3. Dragged the "Lumberjack" folder into the project, made sure that the target was selected and the "copy if needed"-option was selected
  4. Creted a bridging-header, using a dummy-objC-file, and added "#import "
  5. Added "-ObjC" to the linker flags in the targets build settings: linker flags
  6. Added let sdk = PHHueSDK() in AppDelegate

The have performed "clean build folder" When I run the App, I get the following error messages:

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_DDLog", referenced from:

  objc-class-ref in HueSDK_iOS(PHBridgeVersionManager.o)
  objc-class-ref in HueSDK_iOS(PHAuthentication.o)
  objc-class-ref in HueSDK_iOS(PHHeartbeatProcessingLocal.o)
  objc-class-ref in HueSDK_iOS(PHCLIPWrapper.o)
  objc-class-ref in HueSDK_iOS(PHAuthenticationStorage.o)
  objc-class-ref in HueSDK_iOS(PHHueSDK.o)
  objc-class-ref in HueSDK_iOS(PHHttpRequester.o)
  ...   

"_OBJC_CLASS_$_DDTTYLogger", referenced from:

  objc-class-ref in HueSDK_iOS(PHHueSDK.o)

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit

code 1 (use -v to see invocation)

It seems that i have a problem linking the SDK to the project.

What am I doing wrong?

My problem seems to be related to this stack overflow thread. I have also added the SystemConfiguration.framework suggested in that thread, but without success.

Upvotes: 0

Views: 511

Answers (1)

Ron Reuter
Ron Reuter

Reputation: 1347

DDLog is a Lumberjack method, so the linker is not finding the compiled Lumberjack code.

@Rapsefar, I followed the steps exactly as you outlined above using 7.3.1, 9.3, and the current HueSDK_iOS.framework and Lumberjack folder to create an app named "HueSwiftiOS". It compiled and ran without problem. Here is the content of my bridging header file:

//  HueSwiftiOS-Bridging-Header.h
#ifndef HueSwiftiOS_Bridging_Header_h
#define HueSwiftiOS_Bridging_Header_h
#import <HueSDK_iOS/HueSDK.h>
#endif

No linker errors and the call:

let sdk = PHHueSDK()
print("sdk initialized: \(sdk)")

reports:

sdk initialized: <PHHueSDK: 0x125645640>

Project Layout

Target Build Settings

Upvotes: 0

Related Questions