Hello,
I have converted a project from Visual Studio 2003 to Visual Studio 2005 and noticed the following problem: Changing a header file does not recompile all the required dependants. This happens only with precompiled headers on, when I turn them off, everything works. This did not happen in Visual Studio 2003. (Minimal / Incremental Build are OFF).
It is most problemtic when what changed in the header are flags, since it links properly the project is built with some files not updated and creates the most obscure bugs.
Example (just for problem illustration):
Test.h:
#define FLAG_ONE 1
#define FLAG_TWO 2
Files TestFile.c and TestFile2.c both use the header and flags, I edit Test.h and remove FLAG_ONE definition -> with precompiled headers just one C file recompiles, the project links ok, even so it is linked with old code that depends on FLAG_ONE (which should've thrown an error!).
Is this known / Is there a workaround instead of disabling precompiled header (It worked on VC 2003)
Thanks.

Visual C++ 2005 Precompiled Header Bug?
Sriman
As Mike and yourself indicated, it is very hard to reproduce it from my side. If this is a blocking issue, please log it at http://connect.microsoft.com. Make sure to attach the project reproducing the issue so that the owners can take a look.
Thanks in advance for taking the time to log the issue!
Thanks, Ayman Shoukry VC++ Teambharathi_tunes
Anyone ever find a solution to this I experience it very frequently as well on a VS2005 SP1 system running under Vista Ultimate. My solution contains 43 C++ projects with > 5000 files. While it is not blocking, it does waste tremendous time because of the amount of clean rebuilds that must be done.
Thanks.
Malleswar
I have installed Visual C++ 2005 on machine running Vista for debugging compatibility issues.
On this installation I see this problem regularily. The same project compiles without problems on other machines.
Regards
Wolfgang
Microsoft Visual Studio 2005
Version 8.0.50727.363 (SP.050727-3600)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Enterprise
Microsoft Visual C++ 2005 77642-113-3000004-41290
Microsoft Visual C++ 2005
Visual Studio 2005 Team Edition for Developers 77642-113-3000004-41290
Microsoft Visual Studio 2005 Team Edition for Software Developers
Visual Studio 2005 Team Explorer 77642-113-3000004-41290
Microsoft Visual Studio 2005 Team Explorer
Version 8.0.50727.363
Microsoft Visual Studio 2005 Team Explorer - ENU Service Pack 1 (KB918525)
MagedSalah
I believe that I may seeing what you are talking about. People in my software group recently started seeing a c1023 error (unexpected error with pch) occasionally when building large projects. The problem mysteriously coincided with our update to IE7. It seems like one or two of our people see the problem every day. We just clean the project and rebuild. We have been using VS 2005 and hadn't seen any problems like this until now. Just out of curiousity, have you recently updated to IE7
Sorry I can't be of help, good luck.
davide_c
I cannot reproduce this. I tried the following:
- a test.h file that defines those 2 flags
- #include "test.h" in the stdafx.h file that is generated when the project is created
-2 .cpp files that both include stdafx.h
Removing one #define will generate an C2065 'undeclared identifier' error in both .cpp files.
The problem is that I'm using VS2005 SP1 Beta so maybe it has been fixed.
However, precompiled headers should be used only for headers that do not change (or change rarely) like the C/C++ compiler standard headers and the Windows SDK headers. Using precompiled headers for other things can defeat their purpose, for example just removing that #define will trigger the compilation of all files that include the precompiled header and in most cases that means the whole project.
Salemkoten
Mike, thanks for the quick answer.
The example I illustrated is - for illustration - of the problem. My project is big and has many files and headers, it is also a C only project (no C++).
I am not using SP1.
Moreover, I fear that this problem occurs only in specific project configurations (what headers the project uses / how the project hierarchy is constructed). This (or the fact that you use SP1) might be why you could not reproduce the problem. It exists for me and is damn annoying, and it's a bugger that it can't be reproduced with small projects.
I posted the question to see if someone has occured this problem before in the new compiler and if the team is aware of it. It does exist for me.
Thanks again!
StargatePwns
Yes, I have actually installed IE7 about a month ago.
I can't say if the problem started after installing IE7 (which is weird by itself) but I can say that I have just noticed the problem AFTER installing IE7.