不知道这个错误代码意味着什么:“Apple LLVM编译器3.1错误”,“clang因退出代码254而失败”Cocos2D,Xcode 4.3.3

时间:2012-07-06 18:37:52

标签: cocos2d-iphone xcode4.3 clang

环顾四周,我找不到任何令人满意的答案。在SO上发现了一些有关此错误代码的帖子,但他们主要是谈论编译器有点符号和标签没有分配的问题,所以这些问题似乎不适用于此。

在我的HelloWorldLayer.m文件中,我有一个方法可以将CCSprites添加到图层并将它们移动到屏幕上的某些位置。该方法工作正常 - 精灵被初始化和动画正确 - 当我移动每个精灵并单独设置我的BOOL时,如下所示:

[card1 moveToCard1Position];
[opponentCard1 moveToOpponentCard1Position];
[card2 moveToCard2Position];
[opponentCard2 moveToOpponentCard2Position];
[CCDelayTime actionWithDuration: kHoleCardTravelTime];

// BOOLs to determine if the card is in its proper place
card1ReachedPosition = YES;
card2ReachedPosition = YES;
opponentCard1ReachedPosition = YES;
opponentCard2ReachedPosition = YES;

但是我需要在动画实际实时完成之前不要设置bool。因此,当我使用CCSequence将bool的设置延迟到YES时,直到动画完成之后,如下所示:

[self runAction:[CCSequence actions:[CCDelayTime actionWithDuration:0.0], 
             [card1 moveToCard1Position], 
             [opponentCard1 moveToOpponentCard1Position], 
             [card2 moveToHoleCard2Position], 
             [opponentCard2 moveToOpponentCard2Position], 
             [CCDelayTime actionWithDuration:kCardTravelTime], 
             card1ReachedPosition = YES, 
             card2ReachedPosition = YES, 
             opponentCard1ReachedPosition = YES, 
             opponentCard2ReachedPosition = YES, 
             nil]];    

我得到“clang因退出代码254失败”错误。完整的错误,我会在底部显示彻底性。我在HelloWorldLayer.m文件中的其他地方使用了[self runAction:...]就好了,但由于某些原因我无法弄清楚,只有这个方法会抛出254错误。我做错了什么? TIA

CompileC /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o CardGame/HelloWorldLayer.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/Home/Development/zzzMyGames/CardGame
    setenv LANG en_US.US-ASCII
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG -DCOCOS2D_DEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fexceptions -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-conversion -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-generated-files.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-own-target-headers.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-all-target-headers.hmap -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-project-headers.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator/include -ICardGame/libs/kazmath/include -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources/i386 -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources -F/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator -include /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/PrecompiledHeaders/Prefix-ggqxnfadbzynyrexiqnutryhfhfk/Prefix.pch -MMD -MT dependencies -MF /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.d --serialize-diagnostics /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.dia -c /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m -o /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o

0  clang             0x000000010149e422 _ZL15PrintStackTracePv + 34
1  clang             0x000000010149e8a9 _ZL13SignalHandleri + 553
2  libsystem_c.dylib 0x00007fff95754cfa _sigtramp + 26
3  libsystem_c.dylib 0x00007fff60172000 _sigtramp + 18446744072814187296
4  clang             0x0000000100d85de9 (anonymous namespace)::CGObjCCommonMac::EmitMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, llvm::Value*, llvm::Value*, clang::QualType, bool, clang::CodeGen::CallArgList const&, clang::ObjCMethodDecl const*, (anonymous namespace)::ObjCCommonTypesHelper const&) + 1385
5  clang             0x0000000100d88525 (anonymous namespace)::CGObjCNonFragileABIMac::GenerateMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::CodeGen::CallArgList const&, clang::ObjCInterfaceDecl const*, clang::ObjCMethodDecl const*) + 309
6  clang             0x0000000100d64074 clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(clang::ObjCMessageExpr const*, clang::CodeGen::ReturnValueSlot) + 1908
7  clang             0x00000001007110a5 clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 17349
8  clang             0x00000001008ec760 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) + 464
9  clang             0x000000010070fabb clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 11739
10 clang             0x000000010070ccc8 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 72
11 clang             0x00000001008ee819 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) + 57
12 clang             0x00000001008ee715 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) + 1445
13 clang             0x0000000100d6b011 void clang::CodeGen::CodeGenFunction::EmitCallArgs<clang::ObjCMethodDecl>(clang::CodeGen::CallArgList&, clang::ObjCMethodDecl const*, clang::ConstExprIterator, clang::ConstExprIterator) + 97
14 clang             0x0000000100d63e78 clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(clang::ObjCMessageExpr const*, clang::CodeGen::ReturnValueSlot) + 1400
15 clang             0x00000001007110a5 clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 17349
16 clang             0x000000010070ccc8 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 72
17 clang             0x00000001008ee819 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) + 57
18 clang             0x00000001008f1e09 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 41
19 clang             0x000000010070c312 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 242
20 clang             0x000000010070c8eb clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) + 251
21 clang             0x000000010070c69a clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 154
22 clang             0x000000010070c240 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 32
23 clang             0x0000000100d651ba clang::CodeGen::CodeGenFunction::GenerateObjCMethod(clang::ObjCMethodDecl const*) + 58
24 clang             0x000000010061b07c clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 876
25 clang             0x000000010061acef (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 95
26 clang             0x000000010061ac51 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 161
27 clang             0x00000001005e3092 clang::ParseAST(clang::Sema&, bool) + 306
28 clang             0x00000001005e1bd7 clang::CodeGenAction::ExecuteAction() + 855
29 clang             0x00000001005b413f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
30 clang             0x00000001005b2dcb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
31 clang             0x00000001005a55ce cc1_main(char const**, char const**, char const*, void*) + 5086
32 clang             0x000000010057fdd8 main + 648
33 clang             0x000000010057fb44 start + 52
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple i386-apple-macosx10.6.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name HelloWorldLayer.m -pic-level 1 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -target-cpu yonah -target-linker-version 128.2 -g -coverage-file /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/3.1 -dependency-file /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.d -MT dependencies -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-generated-files.hmap -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-project-headers.hmap -include-pch /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/PrecompiledHeaders/Prefix-ggqxnfadbzynyrexiqnutryhfhfk/Prefix.pch.pth -D DEBUG -D COCOS2D_DEBUG=1 -D IBOutlet=__attribute__((iboutlet)) -D IBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName))) -D IBAction=void)__attribute__((ibaction) -D __IPHONE_OS_VERSION_MIN_REQUIRED=50100 -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-own-target-headers.hmap -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-all-target-headers.hmap -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator/include -I CardGame/libs/kazmath/include -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources/i386 -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources -F/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator -fmodule-cache-path /var/folders/gl/wnr8s5t94vqfqf9s9bthyb200000gp/T/clang-module-cache -O0 -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wprotocol -Wdeprecated-declarations -Wno-conversion -Wno-sign-conversion -std=gnu99 -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-exceptions -fexceptions -fpascal-strings -fdiagnostics-show-option -serialize-diagnostic-file /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.dia -o /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o -x objective-c /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m 
1.  <eof> parser at end of file
2.  /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m:52:1: LLVM IR generation of declaration 'HelloWorldLayer::scene'
3.  /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m:339:22: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/gl/wnr8s5t94vqfqf9s9bthyb200000gp/T/HelloWorldLayer-GbrnJj.mi
clang: note: diagnostic msg: /var/folders/gl/wnr8s5t94vqfqf9s9bthyb200000gp/T/HelloWorldLayer-GbrnJj.sh
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254

1 个答案:

答案 0 :(得分:1)

CCSequence获取从CCAction派生的类对象列表。显然card1ReachedPosition不是CCAction类实例,它是BOOL。从代码中很难说,但[card1 moveToCard1Position]可能也不会返回CCAction类的实例。

你想做的事情(除了没有大量的嵌套方法调用)是使用CCCallFunc或CCCallBlock动作分别为你设置bool来中继对moveToXXX方法的调用。