alexpanter
alexpanter

Reputation: 1578

Error C1010 unexpected end of file while looking for precompiled header

I'm getting this error (as title says) with Visual Studio 2019. I have browsed through some other answers here (and elsewhere), but I am actually following the advice that I can find:

Configuration Properties -> C/C++ -> Precompiled Headers has marked the header as enabled, and I have checked that the names match.

But, the precompiled header does not seem to be built (at least I cannot find it in obj/... directory), and this error persists.

I would rather not disable the precompiled header, but rather get it working properly. Any advice?

Upvotes: 1

Views: 2422

Answers (1)

Vlad Feinstein
Vlad Feinstein

Reputation: 11311

You need to specify /Yc (Create Precompiled Header File) for your pch.h file:

https://learn.microsoft.com/en-us/cpp/build/reference/yc-create-precompiled-header-file?view=msvc-160

Upvotes: 2

Related Questions