I clone a repo, c++ solution with 3 projects, a console application .exe
a dll project .dll
and a unit test .dll
. I am not sure with what version of VS or compiler it was built or created.
building the solution on my machine was throwing erro
unexpected end of file while looking for precompiled header. Did you forge t to add '#include "pch.h"' to your source?
I created pch.h
and pch.cpp
according to another solution in every project.
changed the properties->c/c++->precompiled headers
of every project to
precompiled header = Create (/Yc)
precompiled header file = pch.h
precompiled header output file = $(IntDir)$(TargetName).pch
cleared solution and deleted every thing in Debug
folders
now building the solution throws
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forge t to add '#include "stdafx.h"' to your source?
- Also this was the Error Azure pipelines were showing. so to be close to build process of pipeline I use
msbuild.exe
from VS commandline. The weird part for me is that the VC++ right click on solution and build, does not show any error and build project, and after that msbuild.exe also rebuilds without error. But deleting everything from Debug folders and re-trying msbuild.exe shows these errors again!
How should I force all projects in a solution to use stdafx.h
or pch.h