title: Why do you have to link the math library in C?
body: <p>If I include <code>&lt;stdlib.h&gt;</code> or <code>&lt;stdio.h&gt;</code> in a C program I don't have to link these when compiling but I do have to link to <code>&lt;math.h&gt;</code>, using <code>-lm</code> with gcc, for example:</p>
  
  <pre><code>gcc test.c -o test -lm
  </code></pre>
  
  <p>What is the reason for this? Why do I have to explicitly link the math library but not the other libraries?</p>