unable to pass void pointer to a class member
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cython |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I am unable to pass a void pointer to a class member. Im using the following code:
cpdef registerLib(self, fileName):
# lots of code removed
cdef void* lib = dlopen(fileName, RTLD_NOW)
libEntry = Library()
cpdef class Library:
cdef __name
cdef __instances
cdef __instCount
cdef void* handle
def __init__(self):
self.__instances = []
self.__instCount = 0
This code reports th error:
Error converting Pyrex file to C:
-------
...
libEntry = Library()
libEntry.handle = lib
-------
/home/languitar
The same thing happens if I try to use a setter function and any other combination of cdef, cpdef and so on I tried.
You must declare libEntry to be of type Library, i.e.
cdef Library libEntry = Library