xcode4 - XCode 4.2 clang 段错误

标签 xcode4 clang xcode4.2

刚刚升级到 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: 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: 11clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)

  • 这些行号周围没有什么奇怪的。没有复合语句,只是简单的 if (a == b)类型的东西。一些错误行号甚至不在语句中,只是空行或 { 括号。我怀疑行号不准确。我现在有点死在水里了。代码在 4.1 下编译得很好。

    有什么建议吗?

    最佳答案

    我阻止了编译器崩溃。在逐行注释掉代码以查看实际发生的位置后,我到达了这一行:

    shape.shapeType |= kTypeBreakable;
    

    正在做...
    shape.shapeType = shape.shapeType | kTypeBreakable;
    

    ...编译正常。也是...
    shape.shapeType |= 0x00000200;
    
    kTypeBreakable是设置为 0x00000200 的枚举
    shapeType只是一个带有 getter/setting 的 obj-c 对象变量。

    非常非常奇怪的编译器错误。

    关于xcode4 - XCode 4.2 clang 段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7762283/

    相关文章:

    macos - 尝试在 Mac 上安装 openMP/Clang

    c++ - 在 macOS 上将 -fuse-ld=lld 与 Clang 一起使用

    iphone - 具有模糊和斜角的 GLPaint 笔刷效果

    objective-c - clang:错误:链接器命令失败,退出代码为 1 - 找不到库

    iphone - iPhone 的自定义标签栏将标签纵向更改为横向

    xcode - Xcode 中的 Vim 键绑定(bind)?

    iPhone 4 根据 GPS 纬度和一年中的某一天以编程方式计算日持续时间

    iphone - Xcode Storyboard 是否应该支持来自 'dynamic prototype' 单元格的 UITableView 的转场?

    macos - 让scrollWheel开始工作...在WebView中实现上一个和前进的手势

    xcode - 将应用上传到 AppStore