免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5939 | 回复: 1
打印 上一主题 下一主题

请教关于boost.python的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-04 11:41 |只看该作者 |倒序浏览
我的python版本是2.5,boost是 boost_1_37_0,我只安装了boost.python,
安装boost过程
./configure --with-libraries=python --with-python=/usr/local/bin/python --with-toolset=gcc
make
make install

然后,编译了一个最简单的测试文件:
#include <boost/python.hpp>
using namespace boost::python;

char const* greet()
{
   return "hello, world";
}
       
BOOST_PYTHON_MODULE(hello_ext)
{
   
    def("greet", greet);
}

却报下面错误,哪位高人能给指点一下,不胜感激,找不到文件! 
In file included from /usr/local/include/boost/python/detail/prefix.hpp:13,
                 from /usr/local/include/boost/python/args.hpp:8,
                 from /usr/local/include/boost/python.hpp:11,
                 from test_boost_python.cpp:2:
/usr/local/include/boost/python/detail/wrap_python.hpp:50:23: pyconfig.h: 没有那个文件或目录
/usr/local/include/boost/python/detail/wrap_python.hpp:75:24: patchlevel.h: 没有那个文件或目录
/usr/local/include/boost/python/detail/wrap_python.hpp:78:2: #error Python 2.2 or higher is required for this version of Boost.Python.
/usr/local/include/boost/python/detail/wrap_python.hpp:142:21: Python.h: 没有那个文件或目录
In file included from /usr/local/include/boost/python/cast.hpp:13,
                 from /usr/local/include/boost/python/handle.hpp:10,
                 from /usr/local/include/boost/python/args_fwd.hpp:10,
                 from /usr/local/include/boost/python/args.hpp:10,
                 from /usr/local/include/boost/python.hpp:11,
                 from test_boost_python.cpp:2:
/usr/local/include/boost/python/base_type_traits.hpp:24: `PyObject' was not
   declared in this scope
/usr/local/include/boost/python/base_type_traits.hpp:25: template argument 1 is
   invalid
/usr/local/include/boost/python/base_type_traits.hpp:26: confused by earlier errors, bailing out

论坛徽章:
0
2 [报告]
发表于 2008-11-04 13:40 |只看该作者
解决了,我太菜了,忘了 -I/usr/local/include/python
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP