Boost logo

Boost-Build :

Subject: Re: [Boost-build] Windows 10 Universal Application support ( UWP )
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-08-17 03:29:14


Hi Marcin

On 14-Aug-15 8:59 PM, Marcin Godniak wrote:
> Hi Everyone,
>
> I`m developing application for Windows 10 phones and I`d like to use Boost
> in it.
> I`ve tried to build current release (1.59.0) to support UWP but currently
> with no major success.
>
> Using command:
> b2.exe toolset=msvc-14.0 link=static windows-api=store threading=multi
> runtime-link=shared
>
> results in errors like:
>
> libs\filesystem\src\operations.cpp(178): error C2039:
> 'GetEnvironmentVariableW': is not a member of '`global namespace''
> libs\filesystem\src\operations.cpp(178): error C3861:
> 'GetEnvironmentVariableW': identifier not found
> libs\filesystem\src\operations.cpp(182): error C2039:
> 'GetEnvironmentVariableW': is not a member of '`global namespace''
>
> Which I think is due to using API not supported in UWP.

That seems to be correct. Windows Runtime does not include the concept of environment.

> When I tried using header-only portion and I discovered that setting flag
> /ZW (https://msdn.microsoft.com/en-us/library/hh561383.aspx) resolves this
> issue ( I successfully compiled some of asio examples) so I`ve tried to
> pass this flag when compiling with b2.
>
> b2.exe -a -d+2 toolset=msvc-14.0 link=static windows-api=store
> threading=multi runtime-link=shared cxxflags=/ZW
>
> But it yields errors like libs\graph\src\read_graphviz_new.cpp: fatal error
> C1107: could not find assembly 'platform.winmd': please specify the
> assembly search path using /AI or by setting the LIBPATH environment
> variable
>
> So i looked for mentioned file location and tried to use
> using msvc : : :
> <compileflags>/ZW
> <compileflags>/AI"\"C:/Program Files (x86)/Microsoft Visual Studio
> 14.0/VC/lib/store/references/\""
> ;
>
> with b2.exe -a -d+2 toolset=msvc-14.0 link=static windows-api=store
> threading=multi runtime-link=shared
>
> Some libraries compile, but others yields errors like:
> libs\filesystem\src\operations.cpp(178): error C2039:
> 'GetEnvironmentVariableW': is not a member of '`global namespace''
>
> and
>
> libs\context\src\execution_context.cpp(24): error C2483:
> 'boost::context::execution_context::activation_record::toplevel_rec':
> object with destructor or non-aggregate type cannot be declared with thread
> storage duration in WinRT code
>
> I experimented with vcvars scripst and i discovered that passing "store" to
> script sets some variables in promising way, but i couldn't make b2 to pass
> this argument, I`ve tried to use <setup> and <setup-x86> in my
> user-config.jam but with no success. It always used the scrip from <setup>
> and passed argument "x86".
>
> Could you provide me with some guidelines how to compile and use Boost with
> Windows Universal Platform, or any other way to use Boost with Windows 10
> phones?

Please take a look at:

http://blogs.msdn.com/b/vcblog/archive/2014/07/18/using-boost-libraries-in-windows-store-and-phone-applications.aspx

The patches mentioned there are mostly present in 1.59, except for some testing patches not required
for build. However, I think that there are still libraries that don't support Windows Runtime, so
you'd have to see what errors you get, in what libraries, and possibly skip things using

        --without-<library>

option.

HTH,
Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk