Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 773
Druidswarm Avatar asked Jan 09 '19 01:01

Druidswarm


People also ask

How do I get rid of pch H?

To turn off precompiled headersSelect the Configuration properties > C/C++ > Precompiled Headers property page. In the property list, select the drop-down for the Precompiled Header property, and then choose Not Using Precompiled Headers.

What is include pch H?

pch stands for precompiled header. In computer programming, a precompiled header is a (C or C++) header file that is compiled into an intermediate form that is faster to process for the compiler.

What is Stdafx H used for?

The file stdafx. h is usually used as a precompiled header file. Precompiled headers help to speed up compilation when a group of files in a project do not change.


1 Answers

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

like image 55
selbie Avatar answered Oct 20 '22 05:10

selbie