title: How to make g++ do NOT distinguish <string> and <string.h>
body: <p>Recently, I met a very annoying problem. I need to compile some old C++ codes which was compiled with a very old g++ version 4.1.2.</p>
  
  <p>I couldn't find g++ version that old now, so I used g++ 4.4.7 to compile it, but there were many errors like <code>error: ‘snprintf’ was not declared in this scope</code>.</p>
  
  <p>After some work, I found g++ 4.1.2 do NOT distinguish <code>&lt;string&gt;</code> from <code>&lt;string.h&gt;</code>, also <code>&lt;stdio&gt;</code> from <code>&lt;stdio.h&gt;</code>, etc.. But g++ 4.4.7 DOES. So these errors happened.</p>
  
  <p>For some reasons, I couldn't modify the old source code. Is there a way that can make the newer g++ ignore the difference between <code>&lt;string&gt;</code> and <code>&lt;string.h&gt;</code>?</p>