I'm following the Boost.python tutorial, and having some problems with
compiling, of all things. Here's the file I'm trying to compile:
#include
char const* greet()
{
return "Hello, world!";
}
using namespace boost::python;
BOOST_PYTHON_MODULE(hello)
{
def("greet", greet);
}
And here's the compilation error:
% make
g++ -g -Wall -pedantic -I/usr/local/include/boost-1_32 -c -o test.o test.cpp
In file included from
/usr/local/include/boost-1_32/boost/python/detail/prefix.hpp:13,
from /usr/local/include/boost-1_32/boost/python/args.hpp:8,
from /usr/local/include/boost-1_32/boost/python.hpp:11,
from test.cpp:1:
/usr/local/include/boost-1_32/boost/python/detail/wrap_python.hpp:30:23:
pyconfig.h: No such file or directory
/usr/local/include/boost-1_32/boost/python/detail/wrap_python.hpp:54:24:
patchlevel.h: No such file or directory
/usr/local/include/boost-1_32/boost/python/detail/wrap_python.hpp:57:2:
#error Python 2.2 or higher is required for this version of
Boost.Python.
/usr/local/include/boost-1_32/boost/python/detail/wrap_python.hpp:121:21:
Python.h: No such file or directory
In file included from /usr/local/include/boost-1_32/boost/python/cast.hpp:13,
from /usr/local/include/boost-1_32/boost/python/handle.hpp:10,
from
/usr/local/include/boost-1_32/boost/python/args_fwd.hpp:10,
from /usr/local/include/boost-1_32/boost/python/args.hpp:10,
from /usr/local/include/boost-1_32/boost/python.hpp:11,
from test.cpp:1:
/usr/local/include/boost-1_32/boost/python/base_type_traits.hpp:24: error: `
PyObject' was not declared in this scope
/usr/local/include/boost-1_32/boost/python/base_type_traits.hpp:25:
error: template
argument 1 is invalid
/usr/local/include/boost-1_32/boost/python/base_type_traits.hpp:26:
confused by earlier errors, bailing out
make: *** [test.o] Error 1
As near as I can figure, my install of Boost got screwed up. Does
anyone else have a different interpretation?
-Chris Weisiger