I ran into similar errors while attempting to use Boost.python to access Anaconda python packages from C++. Let me start off by saying that my personal impression of the C++ Boost libraries is that they are a great idea with incomplete documentation. There is a ton of documentation on boost.org, but it invariably seems to leave out critical details which the authors appear to consider too trivial to bother mentioning. But, let me get off my soapbox ...
The ongoing impetus for me to [hopefully, eventually] figure out how to get Boost.Python to work on my system is that there are so many great Python scientific packages [SymPy, Numpy, SciPy, matplotlib, etc] included in the Anaconda distribution and it would really be great to access them from C++ projects built with Qt Creator. And the Boost docs do seem to suggest that Boost.Python is supposed to do that for me. Alas, those docs seem to leave out critical details that the authors appear to consider too trivial to bother mentioning ...
Anyway, initially, I got a build error indicating that python.h could not be found. I got rid of that by adding these two statements to my Qt Creator project's .pro file, which tell qmake where Boost installed its include files and where Anaconda installed its python.h file on my system:
INCLUDEPATH += C:\boost_1_55_0
INCLUDEPATH += C:\Anaconda\include
After that, I got a LNK1104 error indicating that 'python27.lib' could not be found. I got rid of that by adding these two statements to my .pro file. The first tells qmake where to find Anaconda's python27.lib file. The second tells qmake where to find the boost.python binary:
LIBS += "C:/Anaconda/libs"
LIBS += "C:/boost_1_55_0/stage/lib/libboost_python-vc110-mt-gd-1_55.lib"
But, that is as far as I have gotten so far. I now get an error indicating it cannot open file 'C:/Anaconda/libs.obj' which I have not yet found a fix for. The error, of course, is caused by that file not existing. The challenge is to discover why it is being sought and where to find it.
#include <Python.h>
doesn't do that. – Bane