locked
fatal error C1010: unexpected end of file while looking for precompiled header. RRS feed

  • Question

  • fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

     

    I am using Visual Studio 2005 Academic Edition.

    I clicked "Tool"=>Options=>Debugging=>Edit and Continue.

    Let "Allow precomping" unchecked then.

     

    Why does this error occury?

     

    Thanks! 

    Tuesday, September 18, 2007 10:21 PM

Answers

  • "Did you forget to add #include "stdafx.h" to your source"?
    Tuesday, September 18, 2007 11:29 PM
    Moderator

All replies

  • "Did you forget to add #include "stdafx.h" to your source"?
    Tuesday, September 18, 2007 11:29 PM
    Moderator
  • I have generated source code and was trying to compile in release mode (instead of debug).  I got this error.  Putting in the #include "stdafx.h" does not fix the problem.  Anyone know what is going on and why I am getting this error in Release mode and not in Debug mode?

     

    Tuesday, October 9, 2007 2:59 PM
  •  

    I figured out what the problem was.  The entire project needed to be marked as 'Not Using Precompiled Headers' in the property pages.  This is under the 'Configuration Properties'->C/C++->'Precompiled Headers'.  You could just single out the one file if you wanted to also.

     

    I then was getting some linker unresolved external errors after doing that.  Make sure you also check for any libraries that need to be linked against.  I had (NOINHERIT) in my Additional Dependencies field of the properties.  That field is under the 'Configuration Properties'->Linker->Input.

     

    Just wanted to put on the board what I found in case anyone else has these easy setup issues.  These things are different from what I am used to or at least in different places.

    • Proposed as answer by Mungyun Friday, October 7, 2011 7:40 PM
    Tuesday, October 9, 2007 5:38 PM
  • Where is

    'Configuration Properties'?

     

    Thanks

    • Proposed as answer by Prizzy29 Monday, October 26, 2009 7:27 AM
    Tuesday, October 9, 2007 6:48 PM
  •  The Steve340 wrote:
    I have generated source code and was trying to compile in release mode (instead of debug).  I got this error.  Putting in the #include "stdafx.h" does not fix the problem.  Anyone know what is going on and why I am getting this error in Release mode and not in Debug mode?

     

    Tuesday, June 24, 2008 9:55 AM
  • Once the C++ is open in a project = Tools/options/”edit/countine” you click on the left side / and then close to the bottom is the option to add or remove 'Precompiled Headers' I had an issue, where there 'Precompiled Headers' came out of no where, I didn't even chose it but, I googled the issue and came up with the site. An I read the idea's on here an searched for it in C++ search and it told me how to do. An I thought I would share the little info.
    Monday, October 26, 2009 7:30 AM
  • Go To 

    I am using Visual Studio 2010.

    Clicked New Project --> Visual C++ --> Win32 Console Application -->

    Enter Name Of Application---> Click Ok

    Show "Win32 Application Wizard" -- > Click Next -->

    In Scrine Show 

    Additional options: 

    Empty project 
    Export symbols 
    Precompiled header 

    Untick Precompiled Header

    then Finished It



    Wednesday, June 6, 2012 11:06 AM
  • Hi..ardmore,

    I was having same problem, but solved it by following manner..

    Open property of that particular page and  go to confi. Property -> c/c++ -> precompiled headers -> set this value to “Not using precompiled Headers”




    • Edited by Mayur.Dabhi Thursday, September 20, 2012 11:06 AM
    Thursday, September 20, 2012 11:05 AM
  • Thank you soo much.. its works fine steve
    Monday, December 31, 2012 7:21 AM