用boost.python为python写c\c++扩展曲折配置最终成功历程
捣鼓了1天多才完成,sign。。。。正确步骤如下:
1 安装boost.python
单独编译boost.python:
bjam -sTOOLS=gcc --with-python --build-type=complete
编译所有:
bjam -sTOOLS=gcc --build-type=complete
清除所有编译:
bjam -sTOOLS=gcc --clean
清除boost.python的编译文件:
bjam -sTOOLS=gcc --with-python --with-python
默认情况下,会在boost源文件下创建了bin.v2文件夹,该文件夹为编译后的二进制库
lwj@lwj-desktop:~/boost_1_37_0/bin.v2
2 创建工程
cd 到 boost_1_37_0/libs/python/example/quickstart
里面是一个样板项目,最为重要的2个文件是Jamroot 和 boost-build.jam
每个项目都要有这两个文件,里面需要配置boost目录。
我的boost-build.jam的内容:
<div class="highlighter">
[*]boost-build/home/lwj/boost_1_37_0/tools/build/v2;
页:
[1]