title: Error C1083: Cannot open source file: "stdafx.cpp': No such file or directory
body: <p>I have the above error and have followed all solutions but does not fix.</p>
  
  <p>This is my stdafx.h file. I have it in the target directory, I can see the file and the full path goes to there. In addition, I have created a win32 project. Why is my code not working?</p>
  
  <pre><code>// stdafx.h : include file for standard system include files,
  // or project specific include files that are used frequently, but
  // are changed infrequently
  //
  
  #pragma once
  
  #include "targetver.h"
  
  #include &lt;stdio.h&gt;
  #include &lt;tchar.h&gt;
  
  
  
  // TODO: reference additional headers your program requires here
  </code></pre>
  
  <p>ACTUAL CODE:</p>
  
  <pre><code>// ConsoleApplication1.cpp : Defines the entry point for the console application. //
  #include "stdafx.h"
  #include &lt;iostream&gt;
  
  int main() {    std::cout &lt;&lt; "Hello world!" &lt;&lt; std::endl;   return 0; }
  </code></pre>