#### Archived

This topic is now archived and is closed to further replies.

# PCH Errors

This topic is 5247 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I recently re-installed Visual C++ and am now receiving hundreds of PCH errors whenever I use classes. The previous installation did not have this problem. A quick search on google revealed that the compiler was finding error with some of my pre-compiled headers and that I should check my compiler documentation to fix the problem. In doing so, I found no solution. Also, I found that unincluding the headers in my project did not resolve the problem at all so I doubt that it is really the headers that I am including that are causing the problems. I also recently found that if put the class definitions all in the same file the errors will go away, but if I seperate the class into a .h and a .cpp I get a PCH error for each class method. E.g.
//test.h

class MyClass
{
public:
MyClass();
};

//test.cpp

#include "test.h"

MyClass::MyClass()
{
//foo

}

This will not work, but the code below does.
//test.h

class MyClass
{
public:
MyClass()
{
//foo

}
};

Has anyone received these errors and somehow fixed them? Does anyone have a clue as to how I can even start fixing this problem. Thank You.

##### Share on other sites
ive gotten PCH problems sometimes too. i had the problem because i did not put the semi colon after the class prototype. the reason it is probably working when you combine the two is because when it is that way the compiler treats it as in-line functions. check your class definition syntax.

##### Share on other sites
If you really get stuck and just want it to work you could just disable the use of precompiled headers in the project settings.