在boost的示例/教程中执行bjam失败

时间:2017-09-13 22:05:44

标签: boost-python bjam

按照http://www.boost.org/doc/libs/1_62_0/libs/python/doc/html/tutorial/tutorial/hello.html

的指示

我在文件夹的目录(C:\ Program Files \ boost \ boost_1_65_1 \ libs \ python \ example \ tutorial)中输入bjam并收到以下错误:

...found 12 targets...
...updating 5 targets...
compile-c-c++ hello.obj
hello.cpp
hello.cpp(7): fatal error C1083: Cannot open include file: 'boost/python/module.hpp': No such file or directory

    call "C:\Users\trg\AppData\Local\Temp\b2_msvc_14.1_vcvars32_.cmd" >nul
cl /Zm800 -nologo @"hello.obj.rsp"

...failed compile-c-c++ hello.obj...
...skipped <p.>hello_ext.dll for lack of <p.>hello.obj...
...skipped <p.>hello_ext.pdb for lack of <p.>hello.obj...
...skipped <p.>hello for lack of <p.>hello_ext.dll...
...failed updating 1 target...
...skipped 4 targets...

如上所述,错误为:fatal error C1083: Cannot open include file: 'boost/python/module.hpp': No such file or directory。使用bjam成功安装了boost C ++库。我使用Eclipse编辑C ++,所有#include <boost/whatever>行似乎都可以编译而不会出错。

任何人都有关于如何解决问题的建议吗?

1 个答案:

答案 0 :(得分:0)

通过取消注释&lt; include&gt;修改文件C:\ Program Files \ boost \ boost_1_65_1 \ libs \ python \ example \ Jamroot声明并将其更改如下:

project
  : requirements
  <include>../../..
  <library>boost_python
;