On Apr 24, 2008, at 12:00 PM, Marco Zanger wrote:

> I made it work. The problem was somewhere else, but when I ran it i  
> get the undefined symbol error that is described here.
>
> http://article.gmane.org/gmane.comp.python.cython.devel/1154/ 
> match=undefined+symbol
>
> But i'm not sure what he means about linking the libraries.

If you were to write a normal .c program that used a c++ library, you  
would have to link to it with -L/path/to/lib/dir or -lname to get it  
to work. The same applies to Cython-generated c files. Hopefully this  
works for you.

Alternatively, you could try using distutils and a setup.py file.

>
>
> Thanks,
> Marco
>
> 2008/4/24, Marco Zanger <[EMAIL PROTECTED]>: Hi, I've been  
> reading the cython documentation and I've some doubts about it.
>
> For example I coded a pyx file named test that calls a C++  
> implementation of the test (ctest.cpp and ctest.h), and then, after  
> writing the setup.py, I compiled with :
>
> ~$ cython test.pyx
>
> after getting the test.c:
>
> ~$ g++ -c -fPIC -I/usr/include/python2.5/ test.c
>
> I used g++ cause gcc sends an error refered to the c+ 
> +implementation. And finally after that I typed:

I believe this is because gcc assumes that .c files are c, and .cpp  
files are c++.

>
>
> ~$ g++ -shared test.o test.so
>
> The question comes now. I want to call that "Cython" code from  
> Python. But when I write
>
> import test
>
> the .so is not recognized by the Eclipse. I'm using Pydev, ¿WHAT  
> THE HELL I'M MISSING HERE?
>
> I text the whole process because I'm not sure that I did the  
> correct things.
>
> Thanks,
> Marco
>
>
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to