artG
artG

Reputation: 235

Unit Target test build fail xcode objective c

Well, when I run app, the app work without any warnings or errors, but when I try to test it i got bunch of errors, like this:

Undefined symbols for architecture x86_64:
"_CGRectGetMidX", referenced from:
  -[GameOver initWithSize:playerLose:] in GameOver.o
  -[GameOver overBackground] in GameOver.o
  -[TitleScene initWithSize:] in TitleScene.o
"_CGRectGetMidY", referenced from:
  -[GameOver overBackground] in GameOver.o
  -[TitleScene initWithSize:] in TitleScene.o
"_OBJC_CLASS_$_SKAction", referenced from:
  objc-class-ref in GameOver.o
  objc-class-ref in TitleScene.o
"_OBJC_CLASS_$_SKLabelNode", referenced from:
  objc-class-ref in GameOver.o
"_OBJC_CLASS_$_SKScene", referenced from:
  _OBJC_CLASS_$_GameOver in GameOver.o
  _OBJC_CLASS_$_TitleScene in TitleScene.o
"_OBJC_CLASS_$_SKSpriteNode", referenced from:
  objc-class-ref in GameOver.o
  objc-class-ref in TitleScene.o
"_OBJC_CLASS_$_SKTransition", referenced from:
  objc-class-ref in GameOver.o
  objc-class-ref in TitleScene.o
"_OBJC_CLASS_$_UIDevice", referenced from:
  objc-class-ref in GameOver.o
  objc-class-ref in TitleScene.o
"_OBJC_METACLASS_$_SKScene", referenced from:
  _OBJC_METACLASS_$_GameOver in GameOver.o
  _OBJC_METACLASS_$_TitleScene in TitleScene.o
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can i resolve this problem?

Upvotes: 0

Views: 456

Answers (1)

Badal Shah
Badal Shah

Reputation: 7602

Go to

TargetSettings -> Build Phases -> Compile Sources -> add your .m file (in which you are getting error) ->Build and Run

and one more possibility is check that you have added all the framework correctly ?

Upvotes: 2

Related Questions