Opened 6 years ago

Last modified 6 years ago

#12266 new Bugs

Visual Studio 2015 Express for Desktop and 64-bit builds

Reported by: carles.cufi@… Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

When building Boost statically as a set of 64-bit static libraries, I have found that using the "usual" Command Prompt doesn't yield 64-bit objects, but rather 32-bit ones.

The build commands I am issuing are:

bootstrap.bat b2 toolset=msvc-14.0 address-model=64 link=static --with-thread --with-system --with-regex --with-date_time --with-chrono

If I open a "Developer Command Prompt" (equivalent to executing %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"") and then build with the commands above, the libraries generated are 32-bit.

If I open a "standard" command prompt (equivalent to %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86) and then build with the commands above, the libraries generated are 32-bit.

Finally, if I open a "Visual Studio 2015 x86 x64 Cross Tools Command Prompt" (equivalent to %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86_amd64) and then build with the commands above, the libraries generated are 64-bit.

This is in my opinion a problem because of two reasons:

1) This contradicts the documentation in: http://www.boost.org/build/doc/html/bbv2/reference/tools.html#bbv2.reference.tools.compiler.msvc where it says: "Configure you compiler as usual. If you provide a path to the compiler explicitly, provide the path to the 32-bit compiler. If you try to specify the path to any of 64-bit compilers, configuration will not work." The usual configuration on Windows is the standard Developer Command Prompt.

2) The build doesn't fail or complain that it cannot generate 64-bit binaries, and instead silently disregards the "address-model=64" option and generates 32-bit binaries.

Please note that with other tools (CMake for example) one can build both 32 and 64-bit binaries from a "standard" command prompt (i.e. no need to invoke vcvarsall.bat x86_amd64).

Change History (1)

comment:1 by carles.cufi@…, 6 years ago

Some relevant links that date from a while back, this might not have been fixed:

http://stackoverflow.com/a/9079872/337201 http://boost.2283326.n4.nabble.com/64-bit-with-VS-Express-again-td3044258.html

Note: See TracTickets for help on using tickets.