在msys下构建boost,找不到mingw.jam

时间:2011-02-16 04:05:11

标签: c++ boost compilation bjam boost-bjam

我需要构建boost才能使用正则表达式库。我能够像使用bootstrap.sh一样创建bjam:

./bootstrap.sh --with-toolset=mingw 

注意 - 如果我遗漏了--with-toolset = mingw参数编译失败 - bootstrap找不到wait.h,resource.h,ar.h。使用mingw工具集参数,bjam能够编译。然后我运行bjam并得到:

./bjam.exe
mingw.jam: No such file or directory
e:/libraries/boost_1_45_0/tools/build/v2/build\toolset.jam:38: in toolset.using
rule mingw.init unknown in module toolset.
e:/libraries/boost_1_45_0/tools/build/v2/build\project.jam:881: in using
project-config.jam:12: in modules.load
e:/libraries/boost_1_45_0/tools/build/v2\build-system.jam:257: in load-config
e:/libraries/boost_1_45_0/tools/build/v2\build-system.jam:423: in load-configuration-files
e:/libraries/boost_1_45_0/tools/build/v2\build-system.jam:554: in load
e:\libraries\boost_1_45_0\tools\build\v2/kernel\modules.jam:283: in import
e:\libraries\boost_1_45_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
e:\libraries\boost_1_45_0\boost-build.jam:17: in module scope

我尝试了几种参数变体并得到了同样的错误:

./bjam.exe --build-dir=e:/libraries/boost_1_45_0/ --toolset=mingw
./bjam.exe --build-dir=e:/libraries/boost_1_45_0/ --toolset=gcc

不确定如何让bjam构建。有什么建议吗?

1 个答案:

答案 0 :(得分:28)

使用./bootstrap.sh --with-toolset=mingw

构建bjam后

编辑文件project-config.jam并将'mingw'替换为'gcc'

然后启动bjam.exe,它应该可以工作