I posted about this problem a few days ago (now deleted), but have since gotten closer to a solution and therefore, I think, better able to ask a constructive question.
I am trying to use Boost.Python in Visual Studio to build a basic C++ 'hello world' function as a .pyd file; my process is as follows:
- Create new empty project
- Set target extension to .pyd and configuration type to .dll
- Include and link necessary Python folders per this guide under the section "Create the core C++ project"
- Import VS2017 Boost.Python3 package via package manager console (PM> Install-Package boost_python3-vc141 -Version 1.65.1)
Then I copy a basic 'hello world' function and wrapper from this website:
#define BOOST_PYTHON_STATIC_LIB
#include <boost/python.hpp>
char const* greet()
{
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext)
{
using namespace boost::python;
def("greet", greet);
}
However, upon attempting to build the solution, I receive the error, "LNK1104 cannot open file 'python27.lib'" I think that my problem is similar to this question, but I tried creating a 'user-config.jam' file in my home directory:
import toolset : using ;
using python : 3.6 : C:\Program Files\Python36\python.exe ;
And I continue to receive the same error message.
How do I force Boost.Python3 to use Python 3.6 instead of the 'default' Python 2.7?