XCode 4 存档错误:找到一个或多个 PCH 文件,但它们无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6063574/
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
XCode 4 Archiving Error: one or more PCH files were found, but they were invalid
提问by The Rat
Documenting an odd XCode 4 Error here for future reference:
在此处记录一个奇怪的 XCode 4 错误以供将来参考:
"one or more PCH files were found, but they were invalid"
“找到了一个或多个 PCH 文件,但它们无效”
Cleaning does not fix the issue, you need to clean the Build Folder by holding down ALT and selecting Product from the menu. The "Clean" entry will now have changed to "Clean Build Folder" which will wipe the bad PCH duplicates and compile without errors.
清理并不能解决问题,您需要通过按住 ALT 并从菜单中选择产品来清理构建文件夹。“Clean”条目现在将更改为“Clean Build Folder”,这将清除错误的 PCH 重复项并无错误地编译。
回答by dnstevenson
I had to read this a few times to get what was going on. The original poster answered his own question. To fix:
我不得不读了几遍才能明白发生了什么。原始海报回答了他自己的问题。修理:
Clean the Build Folder by holding down ALT and selecting Product from the menu. The "Clean" entry will now have changed to "Clean Build Folder" which will wipe the bad PCH duplicates and compile without errors.
通过按住 ALT 并从菜单中选择产品来清理构建文件夹。“Clean”条目现在将更改为“Clean Build Folder”,这将清除错误的 PCH 重复项并无错误地编译。
回答by Dennis
I was experiencing another problem where this solution helped. After updating an external library I rely on, I got this message:
我遇到了另一个问题,这个解决方案有帮助。更新我依赖的外部库后,我收到以下消息:
fatal error: file '/path/to/SomeHeaderFile.h' has been modified since the precompiled header was built
Using a "normal" clean already helped getting rid of it for Debug builds. But when I wanted to use Archive in order to create a new build for the AppStore, the error message remained.
使用“正常”清理已经有助于在 Debug 版本中摆脱它。但是当我想使用 Archive 为 AppStore 创建一个新版本时,错误消息仍然存在。
Using that "Clean Build Folder" now finally solved the problem for me!
现在使用那个“干净的构建文件夹”终于为我解决了这个问题!