[英]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? 我该如何解决这个问题?
Go to 去
TargetSettings -> Build Phases -> Compile Sources -> add your .m file (in which you are getting error) ->Build and Run
TargetSettings->构建阶段->编译源->添加您的.m文件(在其中出现错误)-> Build and Run
and one more possibility is check that you have added all the framework correctly ? 还有一种可能是检查您是否正确添加了所有框架?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.