title: M_PI works with math.h but not with cmath in Visual Studio
body: <p>I am using Visual Studio 2010. I have read that in C++ it is better to use <code>&lt;cmath&gt;</code> rather than <code>&lt;math.h&gt;</code>. </p>
  
  <p>But in the program I am trying to write (Win32 console application, empty project) if I write:</p>
  
  <pre><code>#define _USE_MATH_DEFINES
  #include &lt;math.h&gt;
  </code></pre>
  
  <p>it compiles, while if I write</p>
  
  <pre><code>#define _USE_MATH_DEFINES
  #include &lt;cmath&gt;
  </code></pre>
  
  <p>it fails with </p>
  
  <blockquote>
    <p>error C2065: 'M_PI' : undeclared identifier</p>
  </blockquote>
  
  <p>Is it normal? Does it matter if I use cmath or math.h? If yes, how can I make it work with cmath?</p>
  
  <p><strong>UPDATE</strong>: if I define _USE_MATH_DEFINES in the GUI, it works. Any clue why this is happening?</p>