开发者

Integrating Boost.Python with Visual Studio 8

开发者 https://www.devze.com 2023-02-22 00:12 出处:网络
I\'m having a bit of trouble finding a gui开发者_Go百科de 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,

I'm having a bit of trouble finding a gui开发者_Go百科de 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, e.g: 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消