Boost logo

Boost-Build :

From: Alexey Pakhunov (alexeypa_at_[hidden])
Date: 2005-08-19 03:26:04

Andrey Melnikov wrote:

> - ms-platform-sdk.jam module declares psdk-related features and defines
> common rules;
> - msvc.jam and other toolsets reuse ms-platform-sdk.jam code and contain
> toolset-specific psdk code;


>>It seems PSDK
>>setup script 'SetEnv.cmd' tries to detect MS Visual Studio installation
>>and fails if nothing was found. When two VS installations are installed
>>only the latest will be detected and used.
> Why do you think so? I looked at Windows Server 2003 SP1 SDK and
> SetEnv.cmd looks for %DevEnvDir% and %MSVCDir% first. vcvars32.bat from
> VC7.1 sets both, and vcvars32.bat from vc8 sets only %DevEnvDir%.

I have VS 8 and VC++ Toolkit installed. When I compile using VC++
Toolkit and PSDK, neither %DevEnvDir% nor %MSVCDir% present.
vcvars32.bat from VC++ Toolkit does not set any of them. As result
SetEnv.cmd runs PSDK\Setup\VCDetect.exe which detects VS 8 installation
and calls vcvars32.bat from it.

So what I get is:

VC++ Toolkit\vcvars32.bat
VS 8\vcvars32.bat
cl ...

Actually combining your explanation and mine a solution (for VC++
Toolkit configuration) can be found. We can set %DevEnvDir% and
%MSVCDir% before calling SetEnv.cmd.

> It seems that vcvars + setenv work when I try them manually. Why do you
> think they don't?

The second problem will happen with other than msvc.jam toolsets. If
neither %DevEnvDir% nor %MSVCDir% is present, SetEnv.cmd calls
VCDetect.exe. If no VS installations detected SetEnv.cmd won't set
INCLUDE, LIB and PATH. It will simply print current settings. See below:

REM -------------------------------------------------------------------
Echo Attempting to detect a Microsoft Visual Studio installation
Call "%MSSDK%\Setup\VCDetect.exe" "%TEMP%\VCInit.bat"
IF NOT EXIST "%TEMP%\VCInit.bat" goto ErrorVCEnv
Call "%TEMP%\VCInit.bat"
goto Chk_OS

REM -------------------------------------------------------------------
REM -------------------------------------------------------------------
Echo Warning: The environmental variables MSDevDir and MSVCDir
Echo were not found to exist. Check your Lib, Include and PATH to
Echo verify that the SDK Lib, Include, and Bin directories precede
Echo the compiler directories in the environment.
Echo Note: Microsoft Visual Studio provides VCVARS32.BAT to Set them.
Echo You must run VCVARS32.BAT first and then run SetEnv.cmd.
Echo Current Settings:
Echo Lib=%Lib%
Echo Include=%Include%
Goto Finish

Best regards/Venlig hilsen,
Alexey Pakhunov.


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at