Skip to content

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

  • by

I just finished creating a new Visual Studio Windows Console program, and must have accidentally clicked “use precompiled headers.”  This silly bugger will get you ever time.

The error my debugger gave me was:

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

Helpful, I guess.

The solution was to turn off using precompiled headers. To do this, in the top menus go to: project -> properties (Alt+F7) -> configuration properties -> c/c++ -> Precompiled Headers 

precompiled headers

You will be required to drop down the option that says use and select Not Using Precompiled Headers.

Thanks to the msdn forum for help.

Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

one × one =