November 29, 2007

Fatal error C1010: unexpected end of file while looking for precompiled header directive

Root Cause:
Cpp files in a MFC project have to include "stdafx.h" for creating precompiled headers.

Solution:
#include "stdafx.h" or turn off using precompiled headers.

Visual Studio 2003 .NET
[Properties] of that *.cpp file -> [C/C++] -> [Precompiled Headers]
Set [Create/Use Precompiled Header] to "Not Using Precompiled Headers"