I just compiled my Python wrapper for C++ classes successfully. However, I am getting following messages when I am trying to load my module to the Python (through import c
You should not call your extension/module cell.pyx
, call it differently - for example cycell.pyx
.
Why? The following steps are taken while extension is built
cell.cpp
out of cell.pyx
.cell.cpp
to the object file cell.o
.cell.cc
to the object file cell.o
and overwrites the object file created from cell.pyx
.cell.o
files (but it is in reality only one) - in the result there is nothing what was defined in cell.pyx
/cell.cpp
in particular PyInit_cell
.By renaming the Cython-file you avoid that the object-file is overwritten.
Clearly, another option would be to rename your c++-file.