title: msbuild cannot find precompiled header
body: <p>I have a <code>dll</code> which I build using <code>msbuild</code> with the command <code>msbuild dll.vcxproj /p:Configuration=Debug</code> and it depends on a static <code>lib</code>. My <code>lib</code> have <code>stdafx.h</code> and <code>stdafx.cpp</code> and they are in different folders. </p>
  
  <p>I am using <code>/Yc</code> (create) for <code>stdafx.cpp</code> and <code>/Yu</code> (use) for the rest of the <code>lib</code>. However, I got the error - <code>fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory [lib path.vcxproj]</code>. </p>
  
  <p>In my project settings (Visual Studio 2017), both the <code>lib</code> and <code>dll</code> do include the paths to both the <code>stdafx.h</code> and <code>stdafx.cpp</code>. I tried to specify the path to create the precompiled header in the properties of <code>stdafx.cpp</code> but I got another error - <code>C2857: '#include' statement specified with the /Ycstdafx.h command-line option was not found in the source file stdafx.cpp</code>. </p>
  
  <p>I've also tried to include using relative path (i.e. <code>#include "../path/stdafx.h"</code>) instead of just <code>#include "stdafx.h"</code> inside <code>stdafx.cpp</code> in <code>lib</code> but I got the same error.</p>
  
  <p>Edit: Since my header and source files are separated into different folders, I've tried moving the <code>stdafx.h</code> into the folder of <code>stdafx.cpp</code> and now, the compiler is able to find <code>stdafx.h</code> but I have another error that my other <code>.h</code> files that are included in <code>stdafx.h</code> can't be found. This means that the issue will be solved if I merge my headers and source files into one folder but I want to keep them separated. Is there a way to specify the path of <code>stdafx.h</code> other than the methods that I've tried?</p>