Linking against Boost python 3.6. can't find boost_python instead of boost_python3

后端 未结 3 1874
一生所求
一生所求 2020-12-21 18:27

I have problems linking against boost python.

I am using Visual Studio 2017 and compiled the boost 1_64 package with the following command line:

b2          


        
3条回答
  •  天命终不由人
    2020-12-21 18:42

    Sorry for coming in late here, just went through the same nonsense myself. Turns out that boost doesn't handle two installs very well (or even a py3.x by itself)

    You can definitely solve this by going into and making a quick change. To allow for boost to work with both python 2.x (2.7, presumably) and 3.x, I'd suggest changing:

    #define BOOST_LIB_NAME boost_python

    to

    #if PY_MAJOR_VERSION >=3
      #define BOOST_LIB_NAME boost_python3
    #else
      #define BOOST_LIB_NAME boost_python
    #endif
    

提交回复
热议问题