Search code examples
c++visual-studioboost-python

Using boost/python on Windows


I'm trying to get into C++-extensions for python, with boost/python.

I've downloaded boost 1_73 and installed it by calling bootstrap and then b2 --with-python

In Visual Studio, i've included the compiler include path (the boost directory) and linker library paths (/stage/lib/) that the output of b2 tells me to.

Now I get the compiler error LNK1104 cannot open file 'boost_python37-vc141-mt-x64-1_73.lib'. I can't find any information about this specific error. For everything similar there is only the suggestion to add the above mentioned paths.

The code I'm trying to compile is just the hello world example supplied with boost.

Any ideas?


Solution

  • First check that file exists somewhere in your filesystem. If it doesn't, you may have accidentally built it against a different version (i.e. not 141) of the VC runtime. (This has happened to me when I've had multiple runtimes installed.)

    If you do have the file, then you just need to ensure that the path is in the link settings section of your project config.