Fatal error c1083: Unable to open the pre-compiled header file: "Debug \ A. PCH": no such file or directory

Source: Internet
Author: User

I. Solution

Right-click the project you created, select "Property tag", and click Properties. The "project property page" is displayed ", on the left side, locate the following position to configure properties --> C/C ++ --> pre-compilation header and select it: in the menu on the right, select "do not use precompiled header file" in "Create/use precompiled header file" and click "OK" to exit.

Ii. Cause Analysis

Generally, compilers compile files in units. If a file in the project is modified, all files will be re-compiled, which takes a long time.
To increase Compilation speed, the files that are not often modified and are relatively stable are separately included in a specified header file, and a pre-compiled header file *. PCH is generated. The default header file in VC is stdafx. h, but only header files cannot be compiled, so stdafx is also used. CPP contains only one valid Code. In this way, stdafx is compiled. CPP compiles most system header files, and a pre-compilation information is generated under the DEBUG directory *. PCH file.
If the *. PCH file is damaged or does not exist, an error occurs, indicating that the pre-compiled header file cannot be opened.

3. self-understanding and ideas

The Cause Analysis is in place, but the online solution (for example) is not very good. In my understanding, since the *. PCH file is to be generated, let the program generate one. In case it will be used later, it can save time.

So my approach is in stdafx. in the CPP attribute, select create pre-compiled header file, and then F7 to compile stdafx. CPP file to generate *. PCH file, and then compile main. CPP file.

Fatal error c1083: Unable to open the pre-compiled header file: "Debug \ A. 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.