title: C - undefined reference to "sqrt" even with '-lm'
body: <p>I try to compile a library in C that need "math.h", here is the begining of the .c file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  #include &lt;time.h&gt; 
  #include "sparse_matrix.h"
  ...
  </code></pre>
  
  <p>and I compile with this command:</p>
  
  <pre><code>gcc -c ./sparse_matrix.c -o sparse_matrix.o -lm -Wall -pedantic -std=c99 -g -O
  </code></pre>
  
  <p>But even with the <code>#include</code> done and the flag <code>-lm</code> after the file (I've tried at the end of the line but nothing changed) I still get the error:
      <code>undefined reference to « sqrt » 
       collect2: error: ld returned 1 exit status</code></p>
  
  <p>I don't get it after an hour of googling the issue.
  I'm working with gcc 4.9 under ubuntu 14.10 (utopic unicorn).
  Thank for any help in advance!</p>