title: Visual Studio include path precedence
body: <p>After spending a couple of hours trying to fathom why I was getting a compile error on the call to new in afxtempl.h, having exhausted other solutions found via google I realised there was a local new.h causing the problem (when I say local, I mean it was in one of a few dozen projects that make up the solution).</p>
  
  <p>This took a while to find because I'm only vaguely familiar with the code base and wasn't expecting to find a new.h, but also because I wouldn't have thought this would interfere with the angle bracketed</p>
  
  <pre><code>#include &lt;new.h&gt; 
  </code></pre>
  
  <p>in afxtempl.h. I've always been under the impression that </p>
  
  <pre><code>#include &lt;file.h&gt; 
  </code></pre>
  
  <p>meant look in system includes first.</p>
  
  <p>Looking at the include path from an offending project all I have (other than a couple of local paths that don't actually exist on my machine) are:</p>
  
  <pre><code>$(VC_IncludePath)
  $(WindowsSDK_IncludePath)
  </code></pre>
  
  <p>So given new.h is (was) in a different project how did it get picked up?</p>
  
  <p>I should probably add at this point that the solution has just been migrated from VC++ 6 to VS 2013.</p>
  
  <p>The local new.h doesn't #define _INC_NEW by the way, or define/declare new. The name is just coincidental, it has nothing to do with memory allocation.</p>
  
  <p>I'm just curious if there's some include setting I'm unaware of and would prefer not to have a similarly frustrating few hours in the future.</p>
  
  <p>Thanks.</p>