Sometimes the solution itself gets buggy (often when deleting any files from the solution folders) and you have to create a new project.
When creating a new project, you must specify the option "Use precompiled header." In the settings (properties) of the project, you must specify the key (/ Yu - Use) in the configuration properties tab - C / C ++ - precompiled headers. The .pch file itself will be created automatically.
In order for the precompiled header to function properly, it is necessary that in the "Solution Explorer" во вкладке "Заголовочные файлы". находился stdafx.h, а во вкладке "Файлы исходного кода" stdafx.cpp.
во вкладке "Заголовочные файлы". находился stdafx.h, а во вкладке "Файлы исходного кода" stdafx.cpp.
The system itself automatically creates them there.
The file stdafx.cpp should include the file #include "stdafx.h"