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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 15:38:11  来源:igfitidea点击:

What does "Unexpected precompiled header error" mean?

c++visual-studio-2008compiler-errors

提问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

There is a fix for Visual C++ 2008 SP1 compiler error C1859. You may download it here.

Visual C++ 2008 SP1 编译器错误 C1859 有一个修复程序。你可以在这里下载。

For details see this.

有关详细信息,请参阅

回答by Science_Fiction

We had something similar at work all of a sudden, one day. Our problem was down to this

有一天,我们突然在工作中遇到了类似的事情。我们的问题归结于此

A simple PC restart done it for me anyway.

无论如何,一个简单的 PC 重启就为我完成了。

回答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>因为它可能是您错误背后的罪魁祸首。