INFO: Most Common Causes of C1010 Error

Article translations Article translations
Article ID: 815644
Expand all | Collapse all

On This Page

Summary

This article describes the most common cause for, and how to work around the following C1010 error message:
Fatal Error C1010: unexpected end of file while looking for precompiled header directive

More information

You receive this error message when the following are true:
  • You specify an include file with the /Yu (Use Precompiled Header) command line option that is not listed in the source file. (When you create a Visual C++ project, Use Precompiled Header is set by default with stdafx.h as header file name).
  • You inadvertently delete an #include statement from the source file that referenced the .h file that the /Yu option is looking for.

Workarounds

In a Visual Studio .NET environment, use one of the following methods to work around the problem:
  • If you do not use precompiled headers in your project, set the Create/Use Precompiled Header property of source files to Not Using Precompiled Headers. To set this compiler option, follow these steps:
    1. In the Solution Explorer pane of the project, right-click the project name, and then click Properties.
    2. In the left pane, click the C/C++ folder.
    3. Click the Precompiled Headers node.
    4. In the right pane, click Create/Use Precompiled Header, and then click Not Using Precompiled Headers.
  • Make sure you have not inadvertently deleted, renamed or removed header file (for example, stdafx.h) from the current project. (This header file is specified as Create/Use PCH Through File property)

References

For more information, visit the following Microsoft Developer Network (MSDN) Web site:
Fatal Error C1010
http://msdn2.microsoft.com/en-us/library/d7fz9ckx(vs.71).aspx

Properties

Article ID: 815644 - Last Review: June 20, 2014 - Revision: 3.0
Keywords: 
kbcompiler kbprogramming kbinfo KB815644
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com