I am having problems when linking the following code:
#include <boost/python.hpp>
#include <boost/python/numpy.hpp>
BOOST_PYTHON_MODULE (MyLibrary)
{
Py_Initialize() ;
boost::python::numpy::initialize() ;
...
}
which returns:
undefined reference to `boost::python::numpy::initialize(bool)'
I am using Boost 1.68 with Python 3.6, compiled as follows:
./bootstrap.sh --with-python=/usr/bin/python3 --with-python-version=3.6 --with-python-root=/usr/lib/python3.6
./b2 --with-python link=shared install
And I am linking using:
/usr/bin/c++ -shared
-o MyLibrary.so
MyLibrary.cpp.o
-L/usr/local/lib
-lpython3.6m
/usr/local/lib/libboost_python36.so
Any idea...?
libboost_numpy.so. Check if that has actually been built, i believe it's built automatically if it (and the development headers etc) are installed in your python environment.