什么原因导致 Xcode IDE 中的“clang failed with exit code 255”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14131396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What causes "clang failed with exit code 255" in Xcode IDE?
提问by JRG-Developer
Other users have asked about "clang exit code 255" before, such as in this post:
其他用户之前曾询问过“clang exit code 255”,例如在这篇文章中:
Xcode not compiling any project? 'clang failed with exit code 255'
Xcode 没有编译任何项目?'clang 失败,退出代码为 255'
I know how to fix the error. This usually does it:
我知道如何修复错误。这通常是这样做的:
- Clean the project
- Go to 'Window > Organizer > Project > Delete Derived Data'
- Restart Xcode
- Fixed, like magic...
- 清理项目
- 转到“窗口”>“管理器”>“项目”>“删除派生数据”
- 重启Xcode
- 固定,就像魔法一样......
However, I don't know what causes it, and lately, it's been happening a lot (which is frustrating because it's time consuming).
但是,我不知道是什么原因造成的,最近这种情况发生了很多(这很令人沮丧,因为它很耗时)。
Anyone know what causes this error and how to prevent it from happening?
任何人都知道导致此错误的原因以及如何防止它发生?
回答by David Elliman
Closing and restarting the simulator usually clears this error.
关闭并重新启动模拟器通常会清除此错误。
回答by Developer
I think it also happens when you rename the project in the running state, then XCode will show the project is now missing and it will show the alert with options "Close" and "Resave". If you chose Close then your Derive Data will possesses older name in the path. So, when you try to execute the project next time, it refers to the older path and fails because in that path older name is existing not the new one. So when you clear the Derive Data or restarts the Simulator, the cache files get removed and it runs like a fresh copy.
我认为当您在运行状态下重命名项目时也会发生这种情况,然后 XCode 将显示该项目现在丢失,并显示带有“关闭”和“重新保存”选项的警报。如果您选择关闭,那么您的派生数据将在路径中拥有旧名称。因此,当您下次尝试执行该项目时,它会引用旧路径并失败,因为在该路径中存在旧名称而不是新名称。因此,当您清除派生数据或重新启动模拟器时,缓存文件将被删除,并且它像新副本一样运行。