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?
Asked
Active
Viewed 2,787 times
2 Answers
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
-
I'll try that tomorrow morning – Maciek Jun 23 '10 at 12:53
-
env = Environment(MSVC_VERSION=9.0) Worked. – Maciek Jun 24 '10 at 06:41
-
1MSVC_VERSION='11.0Exp' for making 2012Express. – vrdhn Sep 29 '15 at 03:43
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