title: #pragma hdrstop
body: <p><a href="https://stackoverflow.com/questions/290034/is-there-a-way-to-use-pre-compiled-headers-in-vc-without-requiring-stdafx-h">Is there a way to use pre-compiled headers in VC++ without requiring stdafx.h?</a></p>
  
  <p>Regarding the first answer to this question above,</p>
  
  <p>I tried to implement his solution using visual studio 2010, and failed:</p>
  
  <blockquote>
    <p>fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?</p>
  </blockquote>
  
  <p>Any ideas?</p>
  
  <p>The objective is to NOT use <code>#include "StdAfx.h"</code> anywhere, but instead decide on whether or not to use it during compile time.</p>
  
  <p>If /Yc or Yu are not used, <code>#pragma hdrstop</code> has no effect</p>
  
  <p>If /Yu is used, <code>#pragma hdrstop</code> is replaced with <code>#include "StdAfx.h"</code>, or at least thats the claimed behavior.</p>