草庐IT

BoostPython

全部标签

python - BoostPython 和 CMake

我已成功关注this如何连接C++和python的示例。当我使用给定的Makefile时它工作正常。当我尝试使用cmake时,效果并不理想。C++代码:#include#includeextern"C"charconst*greet(){return"hello,world";}BOOST_PYTHON_MODULE(hello_ext){usingnamespaceboost::python;def("greet",greet);}intmain(){std::cout生成文件:#locationofthePythonheaderfilesPYTHON_VERSION=27PYTHO