Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I added some source files I got from someone else into my project and the compiler gives the error “C1010: unexpected end of file while looking for precompiled header directive.” Why?

0
Posted

I added some source files I got from someone else into my project and the compiler gives the error “C1010: unexpected end of file while looking for precompiled header directive.” Why?

0

By default, Visual C++ projects use precompiled headers. This is a system whereby the large Windows headers are compiled only once when you build stdafx.cpp. Every other .CPP file in your project needs to #include “stdafx.h” as the first #include in order to build. The compiler specifically looks for the name “stdafx.h” to know when to insert the precompiled header information. If you received the source for an entire program from someone else, and you want to build it as a Visual C++ project, you can turn off precompiled headers instead. In your project options, go to the C/C++ tab and select the Precompiled headers category. Click the Not using precompiled headers radio button, then click OK.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.