9

I have a C++ project which is using boost. The whole project is built using scons + Visual Studio 2008. We've installed Visual Studio 2010 and it turned out scons was attempting to use the later compiler instead of the old one - and failed to build the project as boost and visual studio 2010 don't like each other very much - yet. We'd like to suppress this and force scons to use the 2008 version. Is this possible? How do we do this?

Maciek
  • 19,435
  • 18
  • 63
  • 87

2 Answers2

17

You can modify the scons Environment() by just choosing the version you want:

env = Environment(MSVC_VERSION=<someversion>)

From the scons manpage:

MSVC_VERSION Sets the preferred version of Microsoft Visual C/C++ to use.

If $MSVC_VERSION is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system. If the specified version isn't installed, tool initialization will fail. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. Set it to an unexpected value (e.g. "XXX") to see the valid values on your system.

dantje
  • 1,739
  • 1
  • 13
  • 25
2

You'll need to redefine the CXX construction variable, ideally in your Environment:

env = Environment(CXX = "C:\\path\to\vs2008\executable")
Meredith L. Patterson
  • 4,853
  • 29
  • 30