0

Building Boost 1.50 with bjam on MSVC 2010

I'm trying to build the latest Boost (1.50) using MSVC 2010. I have MSVC 2003 and 2008 installed on the same machine (Windows Vista), and have successfully been able to build Boost 1.50 using both toolsets. However I'm having trouble with msvc 2010.

The following is the bjam command I use after having called bootstap.bat:

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

When building MSVC 2010, I get the following error messages:

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

I have very little experience with bjam other than executing the command lines described above. I believe everything is setup correctly, all the compilers are on the PATH environment variable. eg:

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

Furthermore I can't see where in the bjam configs for msvc that the '/Ze' and '/Za' are defined.

Is there something else I'm missing?

Rikardo Koder
  • 672
  • 9
  • 16
  • Only a comment since I don't really know, but it seems to me that the Boost build system uses incompatible arguments to the compiler when building with VS2010. I suggest you add a bug-report on the Boost bug-tracker about it, or at least see if there already is one there. – Some programmer dude Jul 24 '12 at 07:22
  • Some command-line options are specified in *.rsp files (which are prefixed by @ in the cmd-line) -- see what these file contain. Also, check id you have CL environment variable set. My guess is that you've got /Za in CL variable. – Igor R. Jul 24 '12 at 12:50

1 Answers1

1

Instead of adding the compiler to the path, have you tried launching bjam from Visual Studio Command Prompt (found on your Start Menu)?

I never put anything on PATH - I just run that, go to boost folder, bootstrap and build.

Rodrigo Monteiro
  • 390
  • 1
  • 10