Fatal error c1010: unexpected end of file while looking for precompiled header Directive

Source: Internet
Author: User

In the compilation of VC ++ 6.0, the following error occurs: Fatal error c1010: unexpected end of file while looking for precompiled header directive.
.

Solution:

1. if an error occurs, the file is composedCodeIf the file is added to the current project, ALT + F7 will enter the settings of the current project, select the C/C ++ tab, and select precompiled headers from the category combo box, select not using precompiled headers. OK.

2. Add at the beginning of the file:
# Include "stdafx. H"

pre-compiled header files are described as follows:
the so-called header file pre-compilation refers to some of the MFC standard header files used in a project (such as Windows. h. afxwin. h) pre-compilation. Later, this header file will not be compiled and only the pre-compilation results will be used. This will speed up compilation and save time.
pre-compiled header files are compiled by stdafx. CPP generation, named after the project name. Because the precompiled header file is suffixed with "PCH", the compilation result file is projectname. PCH.
the compiler uses the pre-compiled header file through a header file stdafx. h. The stdafx. h header file name can be specified in the project compilation settings. The compiler considers that all commands in the # include "stdafx. H "the previous code is pre-compiled, and it skips # include" stdafx. H "command, using projectname. PCH compiles all the code after this command.
therefore, the first statement of all CPP implementation files is : # include "stdafx. H" .

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.