title: Why do I have to explicitly link with libm?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c">Why do you have to link the math library in C?</a>  </p>
  </blockquote>
  
  
  
  <p>When I write a program that uses functions from the <code>math.h</code> library, why is it that I have to explicitly link to <code>libm</code> even though they are part of the C standard library?</p>
  
  <p>For instance, when I want to use the <code>sin()</code> function I need to <code>#include &lt;math.h&gt;</code> but I also need to pass <code>-lm</code> to GCC. But for any other library from the standard library, I don't have to do that. Why the difference?</p>