Hai friends,
I have a question which is very fundamental..
After installing boost python and bjam from ubuntu 9.04 repositories i can't find a clear detailed description about compiling and running the boost python program from it's tutorials .. Can any among you please tell me what are the options we need to be give to compile like
g++ filename path/to/boost etc.,
and run this hello world boost python program http://wiki.python.org/moin/boost.python/SimpleExample using and without bjam.
This is what i did. I created a c++ file named hello.cpp with the contents..
#include <string>
namespace { // Avoid cluttering the global namespace.
// A couple of simple C++ functions that we want to expose to Python.
std::string greet() { return "hello, world"; }
int square(int number) { return number * number; }
}
#include <boost/python.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(getting_started1)
{
// Add regular functions to the module.
def("greet", greet);
def("square", square);
}
What should i do to make this as "a shared library and put it on the PYTHONPATH" as said in the tutorial?? (This question may sound trivial or silly but these are essential components that "must must" be included while writing a tutorial bcoz. it's gonna be read by people at all levels.. This 'll dampen the spirits of the beginner if he can't get to know how to compile and run it..). Please explain me in detail..
FYI:I'm using python 3.1
Thanks & Regards..