在MSVC 2010上使用bjam构建Boost 1.50时出错

时间:2012-07-24 02:04:13

标签: c++ visual-c++ boost compiler-errors bjam

在MSVC 2010上使用bjam构建Boost 1.50

我正在尝试使用MSVC 2010构建最新的Boost(1.50)。我在同一台机器(Windows Vista)上安装了MSVC 2003和2008,并且已经成功地使用这两个工具集构建了Boost 1.50。但是我在使用msvc 2010时遇到了麻烦。

以下是我在调用bootstap.bat后使用的bjam命令:

bjam --without-mpi --without-python --toolset=msvc-7.1 --build-type=complete -d+2
bjam --without-mpi --without-python --toolset=msvc-9.0 --build-type=complete -d+2
bjam --without-mpi --without-python --toolset=msvc-10.0 --build-type=complete -d+2

构建MSVC 2010时,我收到以下错误消息:

file bin.v2\libs\exception\build\msvc-10.0\release\link-static\runtime-link-static\clone_current_exception_non_intrusive.obj.rsp
"libs\exception\src\clone_current_exception_non_intrusive.cpp" -Fo"bin.v2\libs\exception\build\msvc-10.0\release\link-static\runtime-link-static\clone_current_exception_non_intrusi
ve.obj"    -TP /O2 /Ob2 /W3 /GR /Zc:forScope /Zc:wchar_t /MT /wd4675 /EHs -c
-DBOOST_ALL_NO_LIB=1
-DNDEBUG
"-I."
compile-c-c++ bin.v2\libs\exception\build\msvc-10.0\release\link-static\runtime-link-static\clone_current_exception_non_intrusive.obj

    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"bin.v2\libs\exception\build\msvc-10.0\release\link-static\runtime-link-static\clone_current_exception_non_intrusive.obj.rsp"

Command line error D2016 : '/Ze' and '/Za' command-line options are incompatible
...skipped <pbin.v2\libs\exception\build\msvc-10.0\release\link-static\runtime-link-static>libboost_exception-vc100-s-1_50.lib for lack of <pbin.v2\libs\exception\build\msvc-10.0\r
elease\link-static\runtime-link-static>clone_current_exception_non_intrusive.obj...
...skipped <pstage\lib>libboost_exception-vc100-s-1_50.lib for lack of <pbin.v2\libs\exception\build\msvc-10.0\release\link-static\runtime-link-static>libboost_exception-vc100-s-1_
50.lib...

file bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\codecvt_error_category.obj.rsp
"libs\filesystem\src\codecvt_error_category.cpp" -Fo"bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\codecvt_error_category.obj"    -TP /O2 /Ob2 /W3
/GR /Zc:forScope /Zc:wchar_t /MT /wd4675 /EHs -c
-DBOOST_ALL_NO_LIB=1
-DBOOST_FILESYSTEM_STATIC_LINK=1
-DBOOST_SYSTEM_STATIC_LINK=1
-DNDEBUG
"-I."
compile-c-c++ bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\codecvt_error_category.obj

    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\codecvt_error_category.obj.rsp"

Command line error D2016 : '/Ze' and '/Za' command-line options are incompatible

file bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\operations.obj.rsp
"libs\filesystem\src\operations.cpp" -Fo"bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\operations.obj"    -TP /O2 /Ob2 /W3 /GR /Zc:forScope /Zc:wch
ar_t /MT /wd4675 /EHs -c
-DBOOST_ALL_NO_LIB=1
-DBOOST_FILESYSTEM_STATIC_LINK=1
-DBOOST_SYSTEM_STATIC_LINK=1
-DNDEBUG
"-I."
compile-c-c++ bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\operations.obj

    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\operations.obj.rsp"

Command line error D2016 : '/Ze' and '/Za' command-line options are incompatible

file bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\path.obj.rsp
"libs\filesystem\src\path.cpp" -Fo"bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\path.obj"    -TP /O2 /Ob2 /W3 /GR /Zc:forScope /Zc:wchar_t /MT /wd
4675 /EHs -c
-DBOOST_ALL_NO_LIB=1
-DBOOST_FILESYSTEM_STATIC_LINK=1
-DBOOST_SYSTEM_STATIC_LINK=1
-DNDEBUG
"-I."
compile-c-c++ bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\path.obj

    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo @"bin.v2\libs\filesystem\build\msvc-10.0\release\link-static\runtime-link-static\path.obj.rsp"

Command line error D2016 : '/Ze' and '/Za' command-line options are incompatible

除了执行上述命令行之外,我对bjam的经验很少。我相信一切都设置正确,所有编译器都在PATH环境变量上。例如:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin

此外,我无法看到msvc的bjam配置中定义了'/ Ze'和'/ Za'。

还有其他我想念的东西吗?

1 个答案:

答案 0 :(得分:1)

您是否尝试从Visual Studio命令提示符(在“开始”菜单中找到)启动bjam,而不是将编译器添加到路径中?

我从来没有把任何东西放在PATH上 - 我只是运行它,去boost文件夹,bootstrap和build。