有一些问题,现在我已经阅读了以下内容:
使用boost在c ++中使用hello world python扩展?
我已经尝试将 boost 安装到我的桌面上,并且按照链接方面建议的帖子完成。我有以下代码:
#include <boost/python.hpp>
#include <Python.h>
using namespace boost::python;
现在我尝试与以下链接:
g++ testing.cpp -I /usr/include/python2.7/pyconfig.h -L /usr/include/python2.7/Python.h
-lpython2.7
我也尝试了以下方法:
g++ testing.cpp -I /home/username/python/include/ -L /usr/include/python2.7/Python.h -lpython2.7
我不断收到以下错误:
/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such
file or directory
# include <pyconfig.h>
我不知道我哪里错了。我确实安装了 boost.python,只是链接有问题?