Join GitHub today
Compile problems when trying to link to 1.67.0 python library #193
I decided to give the RC2 a spin and ran into just one issue in my project. We have a DLL which links with the python .lib in windows, and when the MSVC 2017 compiler attempted to parse the library name headers in detail/config.hpp at line 108:
#define BOOST_LIB_NAME boost_python##PY_MAJOR_VERSION##PY_MINOR_VERSION
...it resulted in a linker error looking for boost_pythonPY_MAJOR_VERSIONPY_MINOR_VERSION-vc141-mt-x64-1_67.lib.
I had to modify the header to something like this in order to link properly:
#define _BPYCONCAT(A, B) A ## B #define BPYCONCAT(A, B) _BPYCONCAT(A, B) #define BOOST_LIB_NAME BPYCONCAT(boost_python, BPYCONCAT(PY_MAJOR_VERSION, PY_MINOR_VERSION))
referenced this issue
May 28, 2018
referenced this issue
May 30, 2018
I'm compiling python boost doing:
It builds fine and I add the generated
This happens because
I guess my question is, can boost python being compiled standalone or does it require boost too? If so, how can I build python boost from this repo instead of building it using the latest boost release (which still does not include mentioned fix).
@illera88 as I mentioned, the fix is in master, and will be included in the 1.68 release. There is no way to fix 1.67, as that was released a while ago, and no bug fix release is planned for that.
If you want to help make sure the upcoming 1.68 release works fine, please download boost master and build that.
The question of whether Boost.Python can be built stand-alone is entirely separate from this issue. The answer is: yes, depending on what build tool you are using, you should be able to grab the current master from Boost.Python and build it with an older Boost version pre-installed on your system. See for example the README.md for how to build using Faber...
Thank you @stefanseefeld . Since it was an easy fix I just changed the necessary lines and I made it compile with a 1.67 build.
Just one more question: How can I chose the Python version (and architecture) I want to build python boost against? By default is using Python 3.6 but I have a Python 2.7 I would like to use it against. How can I set that?