I'm trying to create a C++ static library in Visual Studio Express 2013 for Windows Desktop (v12.0.30723.00 Update 3). I don't want to use precompiled headers in my library. I can't get the most basic project to compile without errors.
The problem can be easily duplicated as follows:
- File->New Project
- Select Templates->Visual C++->CLR->Class Library. Click OK to create ClassLibrary1 in the default location.
- In Project->Properties, go to Configuration Properties->C/C++->Precompiled Headers, and set the Precompiled Header option to "Not Using Precompiled Headers".
- Edit the files AssemblyInfo.cpp and ClassLibrary1.cpp, and comment out the #include "stdafx.h" at the top of each file.
- In the Solution Explorer, right-click on Stdafx.cpp and select "Exclude from Project".
- Rebuild the solution.
I get the following two errors:
1 error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? AssemblyInfo.cpp 39 1 ClassLibrary1
2 error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? ClassLibrary1.cpp 7 1 ClassLibrary1
Am I missing a step, or have I found a bug in this version of Visual Studio?