0

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.

Community
  • 1
  • 1
Wiingaard
  • 4,150
  • 4
  • 35
  • 67

1 Answers1

0

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

Ron Reuter
  • 1,287
  • 1
  • 8
  • 14
  • Yeah, I see, but I don't know why it isn't finding it.. I have followed the guide and double and triple checked all the places I think it should be set.. What could I be missing? – Wiingaard Aug 29 '16 at 14:23
  • @Rapsefar, I edited the answer above with more detail. – Ron Reuter Aug 30 '16 at 02:58
  • Thank you very much for your try, I just retried without any luck, still the same 3 errors. Maybe the problem occurs because I also have Xcode 8 - beta installed, eventhough i thought they would be completely seperated.. – Wiingaard Aug 30 '16 at 12:02
  • I've just in Xcode 8 (Version 8.0 beta 2), with the exact same result. – Wiingaard Aug 30 '16 at 12:13
  • @Repsefar, at this point, I have only two suggestions. 1) Delete your project and try again from scratch -- sometimes that actually works. or 2) If there is someway to get it to you, I could zip up my working project and send it to you. – Ron Reuter Aug 30 '16 at 13:32