Just FYI, trying to load my extension I get “ModuleNotFound”.
A test *.py file in the same directory can be imported.
A check on the shared library (dylib on MacOS) shows that the required function 
is exported.
Maybe my layout of the module table is wrong, its hard to say given so much 
information (sarcasm).

The Python function is _fI64918_ptest. 
The function _fI64918_ptest executes correctly when called from C.

If it crashed when called from Python, I wouldn’t be surprised, but the problem
is more basic, the extension can’t be loaded. 

The generated code below compiles fine. The FLX_EXPORT there is the visibility 
control**

static PyMethodDef pycheck_methods [] = {
  {"ptest", _fI64918_ptest, METH_VARARGS, "/Users/skaller/felix/pycheck.flx: 
line 98, cols 1 to 61"},
  {NULL, NULL, 0, NULL}
};
static PyModuleDef pycheck_module = {
PyModuleDef_HEAD_INIT,       // m_base
"pycheck",                  // m_name
"pycheck generated by Felix ", // m_doc
-1,                          // m_size
pycheck_methods,          // m_methods
0,                           // m_reload
0,                           // m_traverse
0,                           // m_clear
0                           // m_free
};
extern "C" FLX_EXPORT PyObject *PyInit_pycheck() { return 
PyModule_Create(&pycheck_module);}

** Python gets the visibilty control wrong for Linux. That’s because Python
is built incorrectly on Linux. But I’m running MacOS so it should work, 
shouldn’t it?


—
John Skaller
skal...@internode.on.net





_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to