Boost.python建设

时间:2010-04-04 05:29:58

标签: python boost building

真的无法理解,如何正确构建使用boost.python的项目。我已经包含了boost_(python / thread / system)-mt。这是简单的模块文件:

#include <boost/python.hpp>
#include "script.hpp"
#include "boost/python/detail/wrap_python.hpp"

BOOST_PYTHON_MODULE(temp)
{
    namespace py = boost::python;

    py::def("PyLog", &engine::log);
}

这是bulid日志:http://dpaste.com/179232/。 无法想象我忘了什么。


系统:arch linux;

ls / usr / lib | grep boost:http://dpaste.com/179233/

2 个答案:

答案 0 :(得分:2)

在链接阶段看起来像一个丢失的库。所有这些未定义的引用都包含在Python库中。您可能只需要在上一个gcc命令中添加类似“-lpython2.5”的内容。

答案 1 :(得分:1)

你似乎错过了python本身的标题。

PySequence_GetSlicePyExc_ValueError等符号来自Python标头,而不是boost :: python标头。

我只能说,对不起。我真的不知道boost :: python。我很惊讶你没有“遗失包含文件”的任何错误。我猜boost :: python本身不包含python头文件?

顺便说一下,我在http://www.boost.org/doc/libs/1_42_0/libs/python/doc/building.html

上看到了以下内容
  

一定不要#include任何   wrap_python.hpp之前的系统头文件。   实际上强加了这种限制   通过Python,或者更正确地说,通过   Python与您的互动   操作系统。看到   http://docs.python.org/ext/simpleExample.html   详情。

也许这有帮助吗?

相关问题