title: Unable to link GSL library in Mac OS X
body: <p>I am trying to use a gsl function in a simple C++ code. I have installed gsl using homebrew, but when I compile with "g++ J0_test.cpp -lgsl -lgslcblas", I get:</p>
  
  <pre><code>"J0_test.cpp:34:10: fatal error: 'gsl/gsl_sf_bessel.h' file not found
  #include &lt;gsl/gsl_sf_bessel.h&gt;  // gsl Bessel special function header file"
  </code></pre>
  
  <p>GSL is installed by brew in /usr/local/Cellar, but it is symlinked to /usr/local/lib. So shouldn't gsl then be on the default search path of the compiler? Either way, even when I try -L /usr/local/lib, I have no luck.</p>
  
  <p>Thanks!</p>
  
  <p>Edit: everything works when I do g++ J0_test.cpp -I/usr/local/include/ -L /usr/local/lib/ -lgsl -lgslcblas</p>
  
  <p>The question is then, why can't I just use -lgsl -lgslcblas if these are on the default path?</p>