Dolly
Dolly

Reputation: 71

fatal error C1852:is not a valid precompiled header file

I have seen all the articles on web, but nothing seems to resolve my issue.

Someone plz help me out on this.

I am using debug mode, VS 2010, .net 4 Framework.

In project properties,
CLR is on in general
CLR in on in C++->general
All .cpp files are having use (/yu) in precompiled hearder settings
stdafx.cpp has /yc (create) with clr on

Upvotes: 3

Views: 3835

Answers (2)

Roee Gavirel
Roee Gavirel

Reputation: 19445

I had the some problem.

Validate that all the C++ files properties (right click on the file in the solution explorer and Properties) are mark with "Common Language RunTime Support" as "/clr"

Upvotes: 4

egur
egur

Reputation: 7960

This error occurs when another version of the compiler has created the PCH file or the PCH is corrupt. Try cleaning the solution or simply rebuilding.

Upvotes: 0

Related Questions