2

For some reason visual studio does not want to cooperate and create the .pch file. I have the following structure:

mysolution.sln
myproject.sln
source
  main.cpp
  stdafx.h
  stdafx.cpp (only includes stdafx.h)

I have set my Project -> Properties -> C/C++ -> Precompiled Headers as (yes, I've checked that stdafx.cpp is set to create as well):

Precompiled Header:         Create (/Yu)
Precompiled Header File:    stdafx.h
Precompiled Header Output:  $(IntDir)$(TargetName).pch

Whenever I try to compile/rebuild the solution, project, or only stdafx.cpp I get:

stdafx.cpp(1,10): error C1083:  Cannot open precompiled header file: 'tmp\Debug\MyProject.pch': No such file or directory

Yes, I've also set my IntDir to: tmp$(Configuration)\

Gregor Sattel
  • 352
  • 3
  • 12

1 Answers1

0

Okay, I fell in the biggest visual studio trap - never selected the correct configuration when modifying the project properties. Everything works as expected.

Gregor Sattel
  • 352
  • 3
  • 12