title: Getting the Gnu Scientific Library to work in Cygwin
body: <p>I'm using gsl and Cygwin, and to get started I am trying to compile a very simple program (which I will later call from a Fortran program). I am unable to get it compile due to problems locating the the gsl files. The code is:</p>
  
  <pre><code>#include &lt;gsl/gsl_math.h&gt;
  
  void gslgateway_(double *x, double *res){
     *res = gsl_atanh(*x);
  }
  </code></pre>
  
  <p>When I try to compile it by:</p>
  
  <pre><code>gcc -c gslgateway.c
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>gslgateway.c:1:26: error: gsl/gsl_math.h: No such file or directory
  </code></pre>
  
  <p>If I change the first line to</p>
  
  <pre><code>#include &lt;C:/cygwin/usr/include/gsl/gsl_math.h&gt;
  </code></pre>
  
  <p>then gsl_math.h is found, but a bunch of other files are not:</p>
  
  <pre><code>In file included from gslgateway.c:1:
  C:/cygwin/usr/include/gsl/gsl_math.h:23:25: error: gsl/gsl_sys.h: No such file or directory
  ...
  </code></pre>
  
  <p>So, the problem seems to be the path to the library files. But try as I might, I can't seem to set this correctly. I used gsl-config as suggested at  <a href="https://stackoverflow.com/questions/1529509/using-gsl-with-cygwin-g">Using GSL with cygwin g++</a> and it gives me</p>
  
  <pre><code>-L/usr/include
  </code></pre>
  
  <p>so I tried compiling using that as an option, but I get the same result. I've also tried setting LD_LIBRARY_PATH to /usr/lib, /usr/include, C:/cygwin/usr/include and several other combinations but nothing works.</p>
  
  <p>I don't know what else to try now. Can anyone see what I'm missing?</p>
  
  <p>(Other info: I have gsl-devel installed. At least, I asked the Cygwin Installer to install it, and I can find a folder /usr/include/gsl that contains gsl_math.h amongst many other files. I don't know if there's anything else I need to do there.)</p>