How do I fix unexpected end of file error with pch.h

Druidswarm picture Druidswarm · Jan 9, 2019 · Viewed 16.2k times · Source

So I have been trying to learn cpp and I was writing a program, and when I try to build the solution, it gives an error saying

unexpected end of file while looking for precompiled header. Did you forget to add #include "pch.h" to your source?

Then I included it and I got the same error, and also another saying

cannot open source file pch.h

screenshot

Answer

selbie picture selbie · Jan 9, 2019

One option, if you are new to c++, is to just turn off pre-compiled headers in the project settings.