hello world python extension in c++ using boost?

Here's my simple first attempt at a python extension using boost. Can someone help me to understand what's causing the compilation error?


#include <iostream>
using namespace std; 
void say_hello(const char* name) {
    cout << "Hello " <<  name << "!\n";
}

#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
using namespace boost::python;

BOOST_PYTHON_MODULE(hello)
{
    def("say_hello", say_hello);
}

user@host:~$g++ main.cpp -o test.so

In file included from /usr/include/boost/python/detail/prefix.hpp:13:0, from /usr/include/boost/python/module.hpp:8, from main.cpp:8: /usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory compilation terminated.
6
задан bitcycle 15 May 2011 в 07:49
поделиться