gpt4 book ai didi

ios - 单元目标测试构建失败 xcode objective-c

转载 作者:行者123 更新时间:2023-11-28 21:09:59 25 4
gpt4 key购买 nike

好吧,当我运行应用程序时,该应用程序在没有任何警告或错误的情况下运行,但是当我尝试对其进行测试时,我遇到了一堆错误,如下所示:

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)

我该如何解决这个问题?

最佳答案

转到

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

还有一种可能性是检查您是否正确添加了所有框架?

关于ios - 单元目标测试构建失败 xcode objective-c ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35627897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com