Cython - properly declaring C funs
- by deepblue
I'm having trouble with running a bare example.
I'm using this to declare a function in Cython coming from cinterf.h header:
cdef extern from 'cinterf.h':
int xsb_init_string(char* p_xsb_path)
The declaration in the C header file is:
DllExport extern int call_conv xsb_init_string(char *);
both DllExport and call_conv are macros defined elsewhere, and resolve to GCC compiler directives.
do I have to use those as well inside cdef to fully match the declaration?
When I call xsb_init_string() as:
xsb_init_string('some string')
The python interpreter gives me:
'ImportError: ./py_ext.so: undefined symbol: xsb_init_string'
Am I declaring the xsb_init_string() signature properly, inside cdef?