VS2010 encountered fatal error C1083: Could not open precompiled header file: "xxx.pch": No such file or directory

Source: Internet
Author: User

C + + and VS2010 is very unfamiliar, but helpless to catch the project, only to see the point of the base on the start, and then encountered this problem.

Cause Analysis:

Http://bbs.csdn.net/topics/340191697?page=1

Compilers are generally compiled in files, and if you modify a file in the project, it will cause all files to be newly compiled, which will take a long time to compile.
In order to improve the speed of the compilation, those are not often modified, relatively stable, the file is contained in a specified header file, and then generate a precompiled header file *.pch. VC in the default header file is StdAfx.h, but the light has a header file can not be compiled, so also to use the StdAfx.cpp contains only a valid code, so compile, compile stdAfx.cpp by compiling most of the system header file, debug directory will produce a The *.pch file that stores the precompiled information.
If the *.pch file is corrupt or does not exist, it will appear with the error that the precompiled header file cannot be opened as shown in the topic.

Workaround:

The first: You can cancel the precompilation of the entire project. Right-click Project-Properties-Configuration Properties-c/c++-precompiled headers-Do not use precompiled headers.

The second kind: stdafx.cpp right--Properties, precompiled header selected "Create", other CPP Select "Use".

Explanation: Transfer from http://www.cppblog.com/silekey/articles/87108.html

Here's a concept to be explained first:

At least one CPP in the 1> code is used to create a pre-programmed Yi header.

2> other CPP are selected using precompiled headers.

3> precompiled headers are a technique that prevents some duplication of compilation to speed up compilation.

4> Most people (I'm the only one, the others never asked). The problem is that he doesn't know each. cpp files are available and must be set separately for the precompiled header parameters!!!!

Then we compile to get the following two errors:

Fatal error C1010: Unexpected end of file encountered while looking for precompiled header.

Fatal error C1083: Could not open precompiled header file: "debug\tmain.pch": No such file or directory

The translation of the corresponding error should be this:

Fatal error C1010: Boss, you said this. cpp file is required with precompiled header, not found on strike!

Fatal error C1083: All using precompiled headers, where is the CPP file where the precompiled header was created!

I'm sorry, I can't do it for you.

VS2010 encountered fatal error C1083: Could not open precompiled header file: "xxx.pch": No such file or directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.