Error Description: Fatal error c1010: Unexpected File ending when searching for pre-compiled headers. Have you forgotten to add "# include" stdafx. H "to the source ""?

Source: Internet
Author: User

Error Description: fatal
Error c1010: unexpected end of the file when searching for the pre-compiled header. Have you forgotten to add "# include" stdafx. H "to the source ""?

Error analysis:   The cause of this error is that the compiler is lookingPre-compiled indicator header file (default # include "stdafx. H ")File is not expected to end. No header file "stdafx. H" is found for pre-compilation instructions ".    (Because every CPP file attribute in the project uses the precompiled header (/YU) by default, but the added third-party file does not include "stdafx. H "indicates the pre-compilation header, so the compiler does not find it in this CPP file until the end)   This problem occurs when I add an existing. h and. cpp file to MFC by adding a file. These. h and. cpp files are open-source standard C ++ files. Source code Category, which has no deeper relationship with MFC.Solution: 1. 1) In Solution Explorer, right-click the corresponding one. CPP file, click "properties" 2) in the configuration properties on the left, click "C/C ++", and click "pre-compile Header" 3) change "Create/use precompiled header" in the first line on the right, and change the option from "use precompiled header (/YU)" to "do not use precompiled header" 4) Note: every error. CPP must be changed like this ~ Work hard ~

You can solve the problem by yourself.

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.