Boost C++ Libraries: Ticket #12644: Windows store - vcvarsall.bat is invoked with wrong arguments https://svn.boost.org/trac10/ticket/12644 <p> When building a store app (ie, <code>windows-api=store</code> in boost), the vcvarsall.bat script (part of Visual Studio) is supposed to be invoked, for example, as </p> <pre class="wiki">&lt;VSPath&gt;\VC\vcvarsall.bat x86_arm store </pre><p> Boost's build system, however, invokes it without the 'store' argument, resulting in a flawed compiler environment. </p> <p> This typically doesn't make a difference when building for desktop, but when building store apps for phone (arm), it can result in missing dll:s when trying to run the app consuming boost. Specifically, various boost dll:s will try to link with kernel32.lib, which does not exist on phone. </p> <p> The origin of the error appears to be in boost_1_62_0/tools/build/src/tools/msvc.jam in the invocation of the <code>maybe-rewrite-setup</code> rule. Here, the <code>setup-options</code> parameter should probably contain 'store', but the <code>&lt;windows-api&gt;</code> feature is never checked to add it. </p> <p> The end result is that, during boost compilation, the library include paths end up wrong and the boost binaries will link with desktop libraries instead of store libraries (eg, VCRUNTIME140D.dll instead of VCRUNTIME140D_APP.dll). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12644 Trac 1.4.3 bjorn.aili@… Tue, 13 Dec 2016 23:34:59 GMT <link>https://svn.boost.org/trac10/ticket/12644#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12644#comment:1</guid> <description> <p> The following patch fixes the issue for our use case: </p> <pre class="wiki">diff --git a/boost_1_62_0/tools/build/src/tools/msvc.jam b/boost_1_62_0/tools/build/src/tools/msvc.jam --- a/boost_1_62_0/tools/build/src/tools/msvc.jam +++ b/boost_1_62_0/tools/build/src/tools/msvc.jam @@ -793,7 +793,7 @@ actions write-setup-script # Local helper rule to create the vcvars setup command for given architecture # and options. # -local rule generate-setup-cmd ( version : command : parent : options * : cpu : global-setup ? : default-global-setup-options : default-setup ) +local rule generate-setup-cmd ( version : command : parent : options * : cpu : global-setup ? : default-global-setup-options + : default-setup ) { local setup-prefix = "call " ; local setup-suffix = " &gt;nul"$(.nl) ; @@ -971,6 +971,9 @@ local rule configure-really ( version ? : options * ) local setup-arm ; local setup-phone-i386 ; local setup-phone-arm ; + local setup-store-amd64 ; + local setup-store-i386 ; + local setup-store-arm ; if $(command) { @@ -1038,6 +1041,10 @@ local rule configure-really ( version ? : options * ) local default-global-setup-options-ia64 = x86_ia64 ; local default-global-setup-options-arm = x86_arm ; + local default-global-store-setup-options-amd64 = x86_amd64 store ; + local default-global-store-setup-options-i386 = x86 store ; + local default-global-store-setup-options-arm = x86_arm store ; + # When using 64-bit Windows, and targeting 64-bit, it is possible to # use a native 64-bit compiler, selected by the "amd64" &amp; "ia64" # parameters to vcvarsall.bat. There are two variables we can use -- @@ -1072,6 +1079,12 @@ local rule configure-really ( version ? : options * ) setup-$(c) = [ generate-setup-cmd $(version) : $(command) : $(parent) : $(options) : $(c) : $(global-setup) : $(default-global-setup-options-$(c)) : $(default-setup-$(c)) ] ; } + local store-cpu = i386 amd64 arm ; + for local c in $(store-cpu) + { + setup-store-$(c) = [ generate-setup-cmd $(version) : $(command) : $(parent) : $(options) : $(c) : $(global-setup) : $(default-global-store-setup-options-$(c)) : $(default-setup-$(c)) ] ; + } + # Windows phone has different setup scripts, located in a different directory hierarchy. # The 11.0 toolset can target Windows Phone 8.0 and the 12.0 toolset can target Windows Phone 8.1, # each of which have a different directory for their vcvars setup scripts. @@ -1167,6 +1180,7 @@ local rule configure-really ( version ? : options * ) } else { + setup-script = $(setup-store-$(c)) ; toolset.flags msvc.compile .CC &lt;windows-api&gt;$(api)/$(cpu-conditions) : $(setup-script)$(compiler) /Zm800 /ZW /EHsc -nologo ; } toolset.flags msvc.compile .ASM &lt;windows-api&gt;$(api)/$(cpu-conditions) : $(setup-script)$(cpu-assembler) -nologo ; </pre> </description> <category>Ticket</category> </item> </channel> </rss>