Boost logo

Boost :

From: maths soso (h.sousou97_at_[hidden])
Date: 2021-07-09 10:09:55

I'm new to boost, I decided installing it by following instructions
provided at SO:
(The only difference is that I used version 1.76)
Everything went fine, then I decided to compile this C++ file:

char const* greet(){
   return "hello, world";}
#include <boost/python.hpp>

    using namespace boost::python;
    def("greet", greet);}

Since boost.python is not header only library, I needed to link to it on
compilation, I used the following compile command:
g++ -I ~/Desktop/boost_1_76_0/ -I /usr/include/python2.7/ main.cpp -o prog

but I get the following errors:
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in
function `_start':
(.text+0x24): undefined reference to `main'
in function `boost::python::converter::registration::get_class_object()
/usr/bin/ld: function_doc_signature.cpp:(.text+0x1de): undefined reference
to `PyObject_IsTrue'
/usr/bin/ld: function_doc_signature.cpp:(.text+0x23e): undefined reference
to `PyInt_FromLong'
/usr/bin/ld: function_doc_signature.cpp:(.text+0x28b): undefined reference
to `PyInt_FromLong'

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