title: Cython, C++ and gsl
body: <p>So I have set up a c++ class with say class.cpp, class.h. class.cpp uses some functions from gsl (it has <code>#include &lt;gsl/gsl_blas.h&gt;</code>)
  I have no problem linking this to another c++ file main.cpp and I can compile it with</p>
  
  <pre><code>g++ -o main main.o class.o  -I/home/gsl/include -lm -L/home/gsl/lib -lgsl -lgslcblas
  </code></pre>
  
  <p>Also, without including the gsl libary in class.cpp, I have managed to create a cython file that uses my class in class.cpp, and it works.</p>
  
  <p>However, when I try to <em>combine</em> these two (ie using a c++ class in cython, where the c++ class uses gsl functions), I do not know what to do. I guess I have to include the </p>
  
  <pre><code>I/home/gsl/include -lm -L/home/gsl/lib -lgsl -lgslcblas
  </code></pre>
  
  <p>somewhere in the setup file, but I dont know where or how. My setup.py looks like</p>
  
  <pre><code>from distutils.core import setup
  from Cython.Build import cythonize
  
  import os
  
  os.environ["CC"] = "g++"
  os.environ["CXX"] = "g++"
  
  setup(
      name = "cy",
      ext_modules = cythonize('cy.pyx'),
  )
  </code></pre>
  
  <p>and I have</p>
  
  <pre><code># distutils: language = c++
  # distutils: sources = class.cpp
  </code></pre>
  
  <p>in the beginning of my .pyx file.</p>
  
  <p>Thanks for any help!</p>