Configuring Visual Studio To Work With Boost.python And Python 3
Solution 1:
With the community help I have found answers to couple of the questions.
- Is it possible to influence the logic used by VS to look for Boost.Python library?
Name of library depends on value defined as macro BOOST_LIB_NAME
in file boost/python/detail/config.hpp
.
I have tried to change line (108 in boost 1.64.0)
#define BOOST_LIB_NAME boost_python
to
#define BOOST_LIB_NAME boost_python3
And desirable library file changed from boost_python-vc120-mt-1_64.lib
to boost_python3-vc120-mt-1_64.lib
.
It should be noted, that instead of changing values in config.hpp
file auto_link.hpp
can be created and used with redefinition of BOOST_LIB_NAME
.
- What option in the project properties should make VS2013 to use different LIB or DLL files, e.g.
libboost_python3-vc120-mt-1_64.lib
orboost_python3-vc120-mt-1_64.dll
instead ofboost_python-vc120-mt-1_64.lib
?
That is also regulated by defines.
In particular, adding to the beginning of my code (before #include <boost/python.hpp>
) the line
#define BOOST_PYTHON_STATIC_LIB
forces MSVS to search file libboost_python3-vc120-mt-1_64.lib
(or libboost_python-vc120-mt-1_64.lib
), i.e. static lib.
And vice versa line
#define BOOST_PYTHON_DYNAMIC_LIB
or
#define BOOST_ALL_DYN_LINK
can be used to import code from a dll.
Post a Comment for "Configuring Visual Studio To Work With Boost.python And Python 3"