37
votes

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:

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?

6
Have you tried rerunning the compiler as the error message suggests?Gordon Bailey
Show us your source, specifically the top of the .cpp file where the #include statements are.egrunin

6 Answers

56
votes

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

For details see this.

6
votes

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.

4
votes

The link provided in the answer above is 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 avoided the restart and kept getting this problem). But after the reboot the error was fixed.

2
votes

Installing visual C++ 2008 SP1 fixed my issue.

1
votes

Install this patch (KB976656 - Error message when you use the Visual C++ 2008 compiler: "fatal error C1859") to fix this issue:

http://thehotfixshare.net/board/index.php?autocom=downloads&showfile=11640

-6
votes

If you have #include<stdfafx.h>, try commenting it out like so //#include<stdfafx.h> as it may be the culprit behind your errors.