On Mon, May 18, 2009 at 7:30 PM, Chris Colbert <[email protected]> wrote:

>
>
>>
>> This error seems like you're not linking to the python library. I
>> would recommend using distutils to compile your files. Can you
>> compile the Cython file
>>
>> print "hello"
>>
>>
>> This is totally doable from Cython.
>>
>>
>  I can compile and use cython modules that don't depend on external c
> libraries with no problem.
>
>
> i thought it was using the external libraries that was killing me, but you
> were right, it was a python linking problem.
>
> using the following distutils script solved my problem, and everything is
> working.
>
> Thanks Robert!
>
> Chris
>
> from distutils.core import setup
> from distutils.extension import Extension
> from Cython.Distutils import build_ext
>
> sourcefiles = ['opencvcython.pyx']
> include_dirs = ['C:\OpenCV\cxcore\include',
>                 'C:\OpenCV\otherlibs\highgui',
>                 'C:\OpenCV\cv\include',
>                 'C:\OpenCV\ml\include']
> library_dirs = ['C:\OpenCV\lib']
> libraries = ['highgui',
>         'cxcore',
>         'cv',
>         'cvaux',
>         'cxts',
>         'cvhaartraining',
>         'ml']
>
>
>
> setup(
>     cmdclass = {'build_ext': build_ext},
>     ext_modules = [Extension("opencvcython", sourcefiles,
>                                 include_dirs=include_dirs,
>                                 library_dirs=library_dirs,
>                                 libraries = libraries)])



i also also have a distutils.cfg file in my distutils directory with the
following (to use mingw)

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

Reply via email to