3

I'm trying to build Boost 1.49.0 using MSVC2010 and it fails with the following error:

file bin.v2\libs\math\build\msvc-10.0\release\link-static\runtime-link-static\threading-multi\assoc_laguerre.obj.rsp
"libs\math\build\..\src\tr1\assoc_laguerre.cpp"
 -Fo"bin.v2\libs\math\build\msvc-10.0\release\link-static\runtime-link-static\threading-multi\assoc_laguerre.obj"
  -Yu"pch.hpp"
 -Fp"bin.v2\libs\math\build\msvc-10.0\release\link-static\runtime-link-static\threading-multi\pch.pch"
 -TP
 /O2
 /Ob2
 /W3
 /GR
 /MT
 /Zc:forScope
 /Zc:wchar_t
 /wd4675
 /EHs
 -c

-DBOOST_ALL_NO_LIB=1

-DBOOST_BUILD_PCH_ENABLED

-DNDEBUG

"-I."

"-Ilibs\math\src\tr1"

compile-c-c++ bin.v2\libs\math\build\msvc-10.0\release\link-static\runtime-link-static\threading-multi\assoc_laguerre.obj

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

assoc_laguerre.cpp
c1xx : fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled header

That is the first instance of that error, my log file has 995 instances of the same error before the build aborts.

The contents of project-config.jam are:

import option ; 

using msvc ; 

option.set keep-going : false ; 

using python : 3.2 : C:\\Tools\\Python\\3.2.2 ;

And the build command I used is:

b2 --toolset=msvc-10.0 --build-type=complete stage -q -d+2 -sICU_PATH="C:\Tools\ICU\4.8.1.1"

Any idea what's causing this?

Praetorian
  • 106,671
  • 19
  • 240
  • 328
  • did you do anything other than the two simple commands: bootstrap / .\b2 ? http://www.boost.org/doc/libs/1_49_0/more/getting_started/windows.html section 5.2 – std''OrgnlDave Mar 22 '12 at 20:57
  • @OrgnlDave I ran `bootstrap` followed by the `b2` command listed above (`b2 --toolset=msvc-10.0 --build-type=complete stage -q -d+2 -sICU_PATH="C:\Tools\ICU\4.8.1.1"`) – Praetorian Mar 22 '12 at 21:06

1 Answers1

9

Here is an explanation of the error, and here is someone who had this problem when building something else and his solution.

He modified his /Zm parameter from /Zm1000 to /Zm500 (you have /Zm800). I don't know if changing it to the same value will help you, but you can try playing with it (this compiler's flag explanation can be found here).

You can use the cxxflags command line argument to modify the compiler flags (taken from here).

Asaf
  • 4,317
  • 28
  • 48
  • Modifying the `/Zm` parameter didn't fix my problem but I'll accept this as the answer since the `cxxflags` argument led me the solution. I used `cxxflags="/Y- "` to ignore all precompiled headers. – Praetorian Mar 23 '12 at 16:46
  • I had the same issue in vc2012 and changing /Zm1000 down to /Zm100 made it work. – marc40000 Aug 20 '12 at 11:53
  • Strange fix with reducing /Zm but it fixed the error. – Dmytro Feb 05 '18 at 13:50