Boost C++ Libraries: Ticket #9214: (Windows) bjam should choose the msvc version from the current visual studio prompt https://svn.boost.org/trac10/ticket/9214 <p> If you have multiple versions of msvc installed bjam seems to choose itself the version of msvc and do not take the current environment into account. </p> <p> This behaviour is totally misleading, beacuse I open a specific Visual Studio prompt with a reason. </p> <p> Bjam should pick the current msvc version out of the msvc prompt by default. </p> <p> Example: I want to build boost through the cmake <a class="missing wiki">ExternalProject</a> mechanism. I have msvc11 and msvc12 installed. Even after I opened a msvc12 prompt, bjam picks msvc11. This will result into linking errors later in the cmake build process because of runtime mismatches. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9214 Trac 1.4.3 Steven Watanabe Mon, 25 Nov 2013 21:18:53 GMT <link>https://svn.boost.org/trac10/ticket/9214#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9214#comment:1</guid> <description> <p> Boost.Build does not use the environment to find Visual Studio. If you want a specific version, please specify it on the command line. </p> <pre class="wiki">b2 toolset=msvc-12.0 </pre> </description> <category>Ticket</category> </item> <item> <author>desurium@…</author> <pubDate>Tue, 26 Nov 2013 15:40:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9214#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9214#comment:2</guid> <description> <p> I do know this command line option. I just don't find it very usefull in an automatic build environment or on a developer machine, where you want to build your dependencies as well. </p> <p> It would be sufficient to have a new command line option like "compiler-detection={auto,cli,off}". I could try to implement such a command line option. </p> <p> But with only "toolset" as the only option, everybody has to check the current active compiler in such an build environment and pass the already choosen compiler version (it was explicitly choosen before by selecting a msvc cli or setting CXX) to bjam again. </p> <p> But something new came into my mind: How does bjam searches for gcc if multiple gcc installations are installed? Does it check CXX? Does it chooses the global activated gcc? </p> <p> I don't think, that is the "best way". Selecting the newest versions if it is possible to say, that the user wants a different compiler isn't intuitive and leads to errors you may notice only very late. </p> <p> Especially for the STL library it can cause different problems if you mix binaries compiled with different STLs. </p> <p> Anyway I don't see any benefit with the current behaviour. What advantages does it have over checking the current active msvc compiler from the environment? </p> </description> <category>Ticket</category> </item> <item> <author>vz-boost@…</author> <pubDate>Mon, 11 May 2015 12:40:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9214#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9214#comment:3</guid> <description> <p> FWIW I also find the current behaviour annoying. It's too easy to forget to specify the toolset, especially when using many different MSVC versions in parallel, it should really be taken from the environment automatically. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Mateusz Loskot</dc:creator> <pubDate>Wed, 20 May 2015 12:07:18 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/9214#comment:4 https://svn.boost.org/trac10/ticket/9214#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">mateusz@…</span> added </li> </ul> Ticket dave@… Tue, 08 Dec 2015 04:58:38 GMT <link>https://svn.boost.org/trac10/ticket/9214#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9214#comment:5</guid> <description> <p> I've just crashed into this *feature* with Boost 1.59.0 when wanting a VS2103 build with VS2015 also installed. Setting <code>toolset=msvc-12.0</code> didn't work; <code>b2</code> reported: </p> <pre class="wiki">notice: [msvc-cfg] msvc-14.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' notice: [msvc-cfg] msvc-12.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe' notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' for msvc, condition &lt;toolset&gt;msvc-14.0 </pre><p> and happily used the version I <strong>did not</strong> specify. </p> <p> The solution is to edit <code>project-config.jam</code> and set: </p> <pre class="wiki">using msvc : 12.0 ; </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Thales Sabino</dc:creator> <pubDate>Wed, 13 Jan 2016 00:46:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9214#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9214#comment:6</guid> <description> <p> I just want to report that this is also happening with me. I have VS2013 and VS2015 installed in my machine and the build engine isn't choosing the corrent version set in the cmd. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thales Sabino</dc:creator> <pubDate>Wed, 13 Jan 2016 00:54:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9214#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9214#comment:7</guid> <description> <p> I also note the following: </p> <p> When there is more than one version of VS installed, there will be environment variables corresponding to each version. In my machine I have the following ones: </p> <p> <strong>VS110COMNTOOLS</strong> -&gt; I think it is for backward compatibility for VS2013 </p> <p> <strong>VS120COMNTOOLS</strong> -&gt; Visual Studio 2013 </p> <p> <strong>VS140COMNTOOLS</strong> -&gt; Visual Studio 2015 </p> <p> So, I tried to temporarilly remove the <strong>VS140COMNTOOLS</strong> variable and the Boost Build Engine started to work. This means that regardless of the VS version it will always use the most recent one. </p> <p> Since I'm using a controlled build environment, I have the ability to remove this environment variable while building boost. </p> <p> Hope this can help someone with the same problem. </p> </description> <category>Ticket</category> </item> </channel> </rss>