2016-02-25 53 views
0

好吧,當我運行的應用程序,該應用程序的工作沒有任何警告或錯誤,但是當我嘗試測試它,我得到了一堆錯誤,像這樣:單位指標測試版本失敗的Xcode目標C

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) 

我該如何解決這個問題?

回答

2

轉到

TargetSettings - >構建階段 - >編譯源代碼 - >添加您的.m文件(在你得到錯誤) - >生成和運行

和一個更多的可能性是檢查你已經正確添加了所有的框架?

+0

是的,由於我的錯誤,我沒有添加所有文件,謝謝。 – artG

+0

歡迎。樂於幫助。 –