Solution to the VC compilation error fatal error c1083

Source: Internet
Author: User

Errors are always ongoing, and experience is cumulative.

C1083: cannot open precompiled header file: 'debug/<project-Name>. pch': no such file or directory

this error results from a missing file-the compiled version of stdafx. CPP. visual c ++ does a poor job of keeping track of this file and frequently "forgets" how to build it. this problem often occurs after restoring a saved workspace from diskette without the DEBUG directory. to fix the error select stdafx. CPP from the workspace file list them choose compile from the build menu. if that doesn't work the go to project-> Settings, select the C/C ++ tab, and click the radio button labeled create precompiled headers.

unexpected end while looking for precompiled header
This module does not include the pre-compiled header file "stdafx. H.
VC uses an stdafx. CPP contains the header file stdafx. h, and then in stdafx. h contains most of the system header files.
when compiling, VC compiles stdafx. CPP pre-compiled most system header files. The DEBUG directory contains
a large file *. the pre-compilation information is stored here.
Based on this principle, if the PCH is damaged or deleted, the system will complain "cannot open
precompiled header file debug/*. PCH" when re-compiling ". In this case, how can we solve this problem? Open project-"
Setting dialog box, select C ++, and select precompiled headers from the category drop-down list box, the simplest
method is to select the first option "not using .... ", in this way, there is no need to pre-compile the header or find the PCH file,
there will be no errors, but the consequence of doing so is that more time will be made for each compilation and connection.
You can also select the second option "automatic... ", and then fill in stdafx in the" Through Header "force. h. In this case,
If the PCH file system does not exist, a PCH is automatically generated. If yes, this PCH is used. This option is "
intelligent.
the third option is to forcibly create a PCH file, and the fourth option is to directly use the PCH file. Of course, stdafx. H is entered in "Through
headers.

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.