C++ “意外的预编译头错误”是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11854470/
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 does "Unexpected precompiled header error" mean?
提问by vico
I was trying to build a simple solution involving a Windows and a Console application. After using the wizard to generate the code skeleton for the projects, I didn't add any code and just built the generated code. In both cases I got the same error:
我试图构建一个涉及 Windows 和控制台应用程序的简单解决方案。使用向导为项目生成代码骨架后,我没有添加任何代码,只是构建了生成的代码。在这两种情况下,我都遇到了相同的错误:
1>c:\c\winpr\winpr\winpr.cpp(4) : fatal error C1859: 'Debug\winpr.pch' unexpected precompiled header error, simply rerunning the compiler might fix this problem
1>c:\c\winpr\winpr\winpr.cpp(4) : fatal error C1859: 'Debug\winpr.pch' unexpected precompiled header error, simply rerunning the compiler might fix this problem
What is wrong, any thoughts?
怎么了,有什么想法吗?
回答by Jacob Seleznev
回答by Science_Fiction
回答by Sia
The link provided in the answer aboveis no longer available.
在提供的链接上面的回答是不再可用。
I was getting the same error and in my case the problem was due to a 'Windows Update' that required a restart (which I avoidedthe restartand kept getting this problem). But after the reboot the error was fixed.
我遇到了同样的错误,在我的情况下,问题是由于需要重新启动的“ Windows 更新”(我避免了重新启动并不断遇到此问题)。但是重启后错误就修复了。
回答by User
Installing visual C++ 2008 SP1 fixed my issue.
安装 Visual C++ 2008 SP1 解决了我的问题。
回答by kofifus
Install this patch (KB976656 - Error message when you use the Visual C++ 2008 compiler: "fatal error C1859") to fix this issue:
安装此补丁(KB976656 - 使用 Visual C++ 2008 编译器时的错误消息:“致命错误 C1859”)来修复此问题:
http://thehotfixshare.net/board/index.php?autocom=downloads&showfile=11640
http://thehotfixshare.net/board/index.php?autocom=downloads&showfile=11640
回答by Art
If you have #include<stdfafx.h>
, try commenting it out like so //#include<stdfafx.h>
as it may be the culprit behind your errors.
如果您有#include<stdfafx.h>
,请尝试将其注释掉,//#include<stdfafx.h>
因为它可能是您错误背后的罪魁祸首。