title: Using pow() function throws undefined reference error in C
body: <p>Why does the following bit of code work in C:</p>
  
  <pre><code>int res = pow(2, 3);
  printf("%d\n", res);
  </code></pre>
  
  <p>while this other doesn't?</p>
  
  <pre><code>int a = 2;
  int b = 3;
  
  int res = pow(a, b);
  printf("%d\n", res);
  </code></pre>
  
  <p>Even if I try </p>
  
  <pre><code>double a = 2;
  double b = 3;
  
  double res = pow(a, b);
  printf("%f\n", res);
  </code></pre>
  
  <p>I get an</p>
  
  <blockquote>
    <p>undefined reference to `pow'</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>