I'm trying to use pybind with an existinc cmake structure. I modified the existing CMakeLists.txt file adding
add_subdirectory(src/pybind11)
pybind11_add_module(mycode src/mycode.cpp)
target_link_libraries(mycode PRIVATE ${MYCODE_LIBRARIES})
This compiles succesfully and generates mycode.so, but when trying to import it via python I get following error:
import mycode
ImportError: ./mycode.so: undefined symbol: PyInstanceMethod_Type
Any ideas what the problem may be?
This might come from a python version mismatch between the version used to compile and the version used to run.
Should be fixed by #2370 and related changes.