title: Using sqrtf() in C: "undefined reference to `sqrtf'"
body: <p>I am using Linux, <a href="https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_12.04_LTS_.28Precise_Pangolin.29" rel="nofollow noreferrer">Ubuntu&nbsp;12.04</a> (Precise Pangolin), and Geany for coding. The code I am writing in C worked completely fine until I used the sqrtf command to find the square root of a float.</p>
  
  <blockquote>
    <p>Error: HAC3.c:(.text+0xfd7): undefined reference to `sqrtf' .</p>
  </blockquote>
  
  <p>The part of code I am using sqrtf() in:</p>
  
  <pre><code>float syn(float *a, float *b, int dimensions)
  {
      float similarity=0;
      float sumup=0;
      float sumdown=0;
      float as=0;
      float bs=0;
      int i;
      for(i=0; i&lt;dimensions; i++)
      {
          sumup = sumup + a[i] * b[i];
          as = as + a[i] * a[i];
          bs = bs + b[i] * b[i];
      }
      sumdown = sqrtf(as) * sqrtf(bs);
      similarity = sumup / sumdown;
      return similarity;
  }
  </code></pre>
  
  <p>I included math.h, but this doesn't seem to be the problem.</p>
  
  <p>Is there a way to fix Geany so this won't come up again?</p>