Original Post
I'm having some problems getting Boost.Python to work. I installed it a while back, and am now working my way through the online tutorial. Or I would be, except that I get stuck on the "We can now build this as a shared library" bit. Here's the file:
#include <boost-1_32/boost/python.hpp>
char const* greet()
{
return "Hello, world!";
}
using namespace boost::python;
BOOST_PYTHON_MODULE(hello)
{
def("greet", greet);
}
And here's the compile errors I get:
% 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 a best guess, I'd say that my Boost install is screwed up somehow. I'd appreciate any insight people can give, including alternate scripting languages that could be more easily integrated into my C++ game engine. I'm working on MacOS 10.3.8, and my version of Python is 2.4.