简体   繁体   中英

Boost, Python: Linker error with Visual Studio 2015

I basically did the same as the person here:

Building/including Boost.Python in VS2013

However, I used an empty cpp file with only the main function and the inclusion of <boost/python.hpp>

#include <boost/python.hpp>


int main() {
    return 0;
}

Now I get the strange linker error (in Visual Studio):

1>LINK : fatal error LNK1104: cannot open file 'boost_python-vc140-mt-gd-1_60.lib'

Which is strange, because I have the lib file I think, however, it is called:

libboost_python3-vc140-mt-gd-1_60.lib

You need to configure your Visual C++ project setting. The following case operates well.

  • [debug platform mode] x64
  • [include directory] (..\\;;);C:\\boost\\boost_1_60_0\\;C:\\Python35\\include\\; # add your actual boost and python directory path
  • [library directory] (..\\;;);C:\\Python35\\libs\\;C:\\boost\\boost_1_60_0\\stage\\lib; # add your actual boost and python library path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM