XCode 4.2 clang 段错误
刚刚升级到 Lion 和 xcode 4.2。现在,当我重新编译程序时,出现以下错误:
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';'
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1:解析Objective-C方法'updateWithTouchLocationMoved:withEvent:view:'
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: 在复合语句 ('{}') 中
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2:在复合语句('{}')中
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1789:3:在复合语句 ('{}')
/Users/XXX/Code/iPhone /XXX/Code/Scenes/GameScene.mm:1796:4:在复合语句('{}')中
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1799:5:在复合语句('{}')中
clang:错误:无法执行命令:分段错误:11
clang: error: clang frontend command failed due to signal 2 (使用 -v 查看调用)
这些行号周围没有任何奇怪的事情发生。没有复合语句,只有简单的 if (a == b)
类型的东西。有些错误行号甚至不在语句上,只是空行或 { 大括号。我怀疑行号不准确。我现在已经快死在水里了。代码在 4.1 下编译良好。
有什么建议吗?
Just upgraded to Lion and xcode 4.2. Now when I recompile my program I getting these errors:
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1806:35: current parser token ';'
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: parsing Objective-C method 'updateWithTouchLocationMoved:withEvent:view:'
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1762:1: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1771:2: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1789:3: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1796:4: in compound statement ('{}')
/Users/XXX/Code/iPhone/XXX/Code/Scenes/GameScene.mm:1799:5: in 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)
There is nothing odd going on around those line numbers. No compound statements, just simple if (a == b)
type stuff. Some of the error line numbers aren't even on statements, just blank lines or a { brace. I suspect that the line numbers are not accurate. I'm kind of dead in the water now. Code compiled fine under 4.1.
Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我阻止了编译器崩溃。在注释掉一行又一行的代码以查看实际发生的情况后,我到达了这一行:
Doing...
...编译正常。也是如此...
kTypeBreakable
是一个设置为0x00000200
的枚举shapeType
只是一个带有 getter/setting 的 obj-c 对象变量。非常非常奇怪的编译器错误。
I stopped the compiler from crashing. After commenting out line after line of code to see where this was actually happening I arrived at this line:
Doing...
...compiles fine. So does...
kTypeBreakable
is an enum that is set to0x00000200
shapeType
is just a obj-c object variable with a getter/setting.Very very odd compiler bug.