python - Importing extern declaration from other Cython declaration file -
i writing cython extension use in python.
i have cython declaration .pxd file declares c struct defined in other c header file:
# cython definitions parameters.h cdef extern "parameters.h": ctypedef struct control_par: int num_cams # other struct fields....
now want same thing other header file here have use defined above: control_par
c struct in cython .pxd
file:
from optv cimport parameters, calibration # no error here during setup cdef extern "optv/trafo.h": void pixel_to_metric(# other parameters... control_par * parameters);
during cythonizing error:
'control_par' not type identifier
like not defined @ all.
what doing wrong?
the correct way import c definitions parameters.control_par
. do:
from optv.parameters cimport control_par, whatever_else_you_need
Comments
Post a Comment