Extract in C++ a Python object inherited from C++ Class
问题 I want to export an abstract class from C++(Base) to create an inherited class in Python(Derived) and finally extract that class for create a C++ pointer object(Base*). I find this solution. but it didn't work for me although it compiles, the execution halt with an exception. My code is this: #if PY_MAJOR_VERSION >= 3 # define INIT_MODULE PyInit_module extern "C" PyObject* INIT_MODULE(); #else # define INIT_MODULE initmodule extern "C" void INIT_MODULE(); #endif int main() { PyImport