1
votes

I am fairly new to boost python, and I am attempting to follow this tutorial: https://www.boost.org/doc/libs/1_63_0/libs/python/doc/html/tutorial/tutorial/hello.html . Following the tutorial exactly, I receive this error upon building the project using either b2 or bjam:

" fatal error LNK1181: cannot open input file 'boost_python.lib' "

I believe I have properly configured my user-config.jam, jamfile, and jamroot files.

I also saw this thread here: LNK1181: cannot open input file 'boost_python.lib' in windows, boost_1_68_0 but no solutions to the issue seemed to have been provided. Instead it is suggested that bjam/b2 are not needed at all, which seems to contradict the tutorial in the boost documentation.

The same user then suggested "linking" with the boost python and python libraries, which I assume means to add their directories to system environment variables. I have already done this, but I believe I could be misunderstanding what he meant.

The thread also links to this page: https://docs.microsoft.com/en-us/visualstudio/python/working-with-c-cpp-python-in-visual-studio?view=vs-2017 detailing the creation of c++ extensions for Python, but after reading it I fail to see any mention of boost whatsoever except in passing at the very end of the article.

I have also searched the entire boost directory for a 'boost_python.lib' file and it seems that it does not exist. Any help would be greatly appreciated.

1

1 Answers

0
votes

A quick Google search brought me to this answer:

You need to build the shared boost_python library using this command:

bjam toolset=msvc --prefix=..\\%BOOST_PREFIX% --with-python 
--python=2.7 release link=shared --build-type=complete 
address-model=64 install 

You might have to adjust some options, but it should work as it worked for someone else.

-u/GeeDeexd