On Thu, Apr 24, 2008 at 03:23:58PM -0300, Marco Zanger wrote:
> 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
>
Don't you also need to have your ctest.cpp file that you are wrapping as one
of the arguments? Are the missing symbols from your .cpp file?
If you wan't I would use the setup.py file with contents:
####### Begin setup.py
from distutils.core import setup
from distutils.extension import Extension
pyx_sources = ['test.c', 'ctest.cpp']
pyx_ext = Extension('test', pyx_sources)
setup(name='test',
ext_modules=[pyx_ext])
###### End setup.py
and run it with
$ python setup.py build_ext --inplace
And you should be off to the races!
Gabriel
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev