- Download Boost library and create bjam using bootstrap.bat script file
- If you use older Boost (prior to version 1.57.0) you have to open user-config.jam on tools/build/v2/, and type following section
using python : 3.4 : C:\\Python34 : C:\\Python34\\include : C:\\Python34\\libs;
It will depend on the Python version you installed on your system.And again, if you use Boost library version 1.57.0 you don't have to edit the user-config.jam.
- Build boost library with python support ( --with-python)
- Open Up your Visual Studio IDE, create new dll project
- Copy the simple program that includes in python boost documentation
- Open property page of your project
- Change Target Extension into .pyd
- Change Target Name match with your extension module
- Add include directory with python include directory and your new installed boost library
- Add the library directory with your python libs path and with your boost's libs path
- Add additional dependency with python34.lib , DO NOT use python3.lib, it might caused troubled when loading library during python execution
- Build and test the library
- If there is troubled while loading your pyd file, it might need some "dll, track its
dependency using tools which you can download from http://dependencywalker.com/
NOTE:
Add this line in your source codes project if you configure your project using static library
#define BOOST_PYTHON_STATIC_LIB
This is the boost python library build command
$ bjam --build-dir=D:\\Boost\\BuildDir --build-type=complete --with-python link=static threading=multi stage