Boost logo

Boost :

From: edcjones_at_[hidden]
Date: 2001-06-08 09:52:53

Suppose I have some compiled code as a ".a", ".so", or ".o" file. Also
suppose that I have the header files but not the source code. How do I
use Boost.Python to wrap the stuff?

Here is an attempt at an example based on "getting_started1". What did
I do wrong?

#include <string>

std::string greet();
int square(int number);


#include "gs1.hpp"

std::string greet() { return "hello, world"; }
int square(int number) { return number * number; }


#include "gs1.hpp"
#include <boost/python/class_builder.hpp>

namespace python = boost::python;

    python::module_builder this_module("getting_started1");
    this_module.def(greet, "greet");
    this_module.def(square, "square");

Boost list run by bdawes at, gregod at, cpdaniel at, john at