简体   繁体   中英

Integrating Boost.Python with Visual Studio 8

I'm having a bit of trouble finding a guide that allows me to integrate the Boost.Python compilation into VS 8. It seems like it depends heavily on this bjam utility to build the source, but there isn't any mention of how this can integrate into VS 8 interface.

I can see that the bjam program calls VS 8 to do much of the compilation.

bjam is used for compiling boost itself (although your can use it as configuration tool for your code aswell). Running the utility should compile the library and does not require any further work, afaik. The include and library paths you have listed in your second post are correct, as far as I can tell (assuming the path to the directories you listed is correct, eg: C:\\Python27\\include).

While I was playing around with boost.python, I found out I was not able to compile any C++/Python libraries with a 64 bit version of Python installed. I first had to remove the 64 bit version and install the 32 bit version.

Also the compilation was only successful if I included #define BOOST_PYTHON_STATIC_LIB before the #include statements. I still have not figured out why.

I hope my answer (my first one ever on this site, so don't be too harsh with me ;) ) was of any use.

I found the issue, thanks for the suggestion Phillip. It turns out I just needed to provide the correct header and library directories to VS 8 and compile as a DLL (not a console program).

Include Directories:

  • \\boost-python\\boost_1_46_1
  • \\Python27\\include`

Library Directories:

  • \\Python27\\libs
  • \\boost-python\\boost_1_46_1\\stage\\lib`

Can anyone confirm these are the right directories to be used for including and linking?

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