2008/08/21

boost::python

最近boost::pythonを使うため、ネットで情報を集めている。そのとき、かなりの割合で不適切な情報を見る。
まず、
#include <Python.h>

は、使うべきではない。
#include <boost/python/detail/wrap_python.hpp>

とするべきである。何故ならVC++にはauto-linkingなる非常に便利でおせっかいなシステムがあり、
In Debug mode, this auto links boost_python-vc80-gd-1_35.dll which is
the Boost Python debug lib which does not define PY_DEBUG which is not
the behaviour I want. The Boost Python docs makes some reference to
using BOOST_DEBUG_PYTHON to change the behavior of wrap_python.hpp

だからである。もっとも、
but
no such support seems to exist to modify the auto-linking behavior.

というバグもついてくるけれど\(^o^)/

参考:http://mail.python.org/pipermail/c++-sig/2008-April/013457.html

0 件のコメント: