You are not logged in.
I have bean trying to compile the basic boost.python example program on arch, but g++ is spitting out errors stating that it cannot find Python.h and so on.
#include <boost/python.hpp>
char const* greet()
{
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext)
{
using namespace boost::python;
def("greet", greet);
}
g++ boost_python_test.cpp
In file included from /usr/include/boost/python/detail/prefix.hpp:13,
from /usr/include/boost/python/args.hpp:8,
from /usr/include/boost/python.hpp:11,
from boost_python_test.cpp:1:
/usr/include/boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
/usr/include/boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory
/usr/include/boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for this version of Boost.Python.
/usr/include/boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory
^C
...
tonnes of errors.
Last edited by Hessiess (2009-04-30 21:25:26)
Offline
This should compile:
g++ boost_py.cpp -lboost_python -lpython2.6 -I /usr/include/python2.6/ -o boost_py.so -shared
Offline
Thanks, that compiles, however the module fails to import.
>>> import boost_py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (initboost_py)
>>>
Offline
Rename
BOOST_PYTHON_MODULE(hello_ext)
to
BOOST_PYTHON_MODULE(boost_py)
Offline
Thanks, it works:).
Offline
Don't forget to put SOLVED in the title on your solved issue's please.
Offline
Don't forget to put SOLVED in the title on your solved issue's please.
Done
Offline