title: Linking Math library to a C90 code using GCC
body: <p>I would like to compile a simple C90 code utilizing math library:</p>
  
  <p><em>main.c:</em></p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main()
  {
    printf("M_PI: %f\n", M_PI);
  }
  </code></pre>
  
  <p>I use GCC compiler and use option -ansi -pedantic to enforce C90 standard.</p>
  
  <pre><code>gcc -ansi -pedantic -lm main.c
  </code></pre>
  
  <p>But it doesn't compile. The following is the error message:</p>
  
  <pre><code>main.c: In function ‘main’:
  main.c:7:25: error: ‘M_PI’ undeclared (first use in this function)
  main.c:7:25: note: each undeclared identifier is reported only once for each function it appears in
  </code></pre>
  
  <p>My question is, why? Does C90 standard prohibits the use of math library?</p>