title: undefined reference to `cos' when I use iso_c_binding
body: <p>I have the Fortran90 function</p>
  <pre><code> function eg_fun(r) bind(c)
    use, intrinsic :: iso_c_binding
    implicit none
  
    real(c_double), intent(in) :: r
    real(c_double)             :: eg_fun
  
    real(c_double), parameter :: PI = acos(-1.d0)
  
    eg_fun = PI * r * r + cos(r)
  end function
  </code></pre>
  <p>and my C program</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  extern double eg_fun(double *r);
  
  int main(int argc, char **argv){
      double r;
  
      printf(&quot;Enter the argument\n&quot;);
      scanf(&quot;%lf&quot;, &amp;r);
  
      printf(&quot;The result is %lf\n&quot;, eg_fun(&amp;r));
  
      return 0;
  }
  
  </code></pre>
  <p>I want to use the Fortran function under the C program using the iso_c_binding tool. But when I try to compile thos with <code>gcc -Wall main.c routine.f90 -o app -lgfortran</code> I receive the error message</p>
  <pre><code>/tmp/ccn2Zeac.o: In function `eg_fun':
  routine.f90:(.text+0x42): undefined reference to `cos'
  collect2: error: ld returned 1 exit status
  
  </code></pre>
  <p>How I can solve this?</p>