Search code examples
iosobjective-ciphonexcodewatchkit

Linker command failed in XCode 6.2 using MMWormhole Library and Watchkit


When trying to build the app I get a "linker command failed with exit code 1" error. Here is what the error looks like from Xcode:

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MMWormhole", referenced from:
  objc-class-ref in InterfaceController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Looks like the Library wasn't biult for x86-architecture but that is just a wild guess from what I have read so far. When I remove the architecture from the valid architechtures in "Build Settings" the error message is gone but I get another one.

Did anybody make some experience with MMWormhole and knows what to do?


Solution

  • My guess is that you only included MMWormHole in your iOS app target and not in your WatchKit extension. If you just import the source code and not a library you need to check the targets for the source code and make sure both the iOS app and the WatchKit extension are selected (see Calling a Method on Watchkit). If you include or build a library, you need to check the settings in both your iOS app and your WatchKit extension and make sure they are both linking against the library.