I am trying to declare a Cython class in a pxd file but can't compile it when I try to assign a pointer.
The following pyx compiles fine :
cdef class Foo:
cdef void *_void
cdef set_ptr(self, void *ptr):
self._void = ptr
But when I split it in 2 files according to the Cython documentation :
.pxd
cdef class Foo:
cdef void *_void
cdef set_ptr(self, void *ptr)
.pyx
cdef class Foo:
cdef set_ptr(self, void *ptr):
self._void = ptr
I get the following error:
Error compiling Cython file:
------------------------------------------------------------
...
# -*- coding: utf-8 -*-
cdef class Foo:
cdef set_ptr(self, void *ptr):
self._void = ptr
^
------------------------------------------------------------
test/test.pyx:5:21: Cannot convert 'void *' to Python object
What can I do to make it compile ?
setup.py, which was different from the name of the files - Saelyos