Boost logo

Boost :

Subject: Re: [boost] [filesystem, regex, asio] These three libraries successfully ported to Windows Phone 8.1
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2015-01-28 09:55:47


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Moshe Rubin
> Sent: 28 January 2015 14:14
> To: boost_at_[hidden]
> Subject: Re: [boost] [filesystem, regex, asio] These three libraries
successfully ported
> to Windows Phone 8.1
>
> On January 27, 2015 09:55 GMT, Paul A. Bristow wrote:
>
> >>> And thank you very much for the improved WinRT support.
> >>
> >> My pleasure. It was an education for me (in the positive sense of
> >> the
> >> word!) participating in porting Boost. I will only rest on my
> >> laurels once the port authorized by the crew and back in the repository
<g>.
> >
> > I'm pleased to see that Windows Phone developers will now be able to use
these
> Boost libraries.
>
> When we went looking for Boost ports for Windows Phone 8, we had a sinking
> feeling because no one had ported any of the libraries to WinRT. Steven Gates
of
> Microsoft took the first step, and was a great encouragement to me and my
> company. I'm glad to be able to return the favor to the Boost project, as we
have
> benefited very much from this excellent collection of libraries.
>
> > I'm also curious to know if you have tried to port the Boost.Math library?
> >
> > Although it contains a lot of esoteric mathy stuff that are unlikely
> > to be mainstream on a phone app, there are also some very simple-to-use
> statistics stuff that will/should be widely applicable.
> >
> > Have you tried this yet? Are there any obstacles that you can foresee?
>
> We did not need Boost.Math in our product so I did not look into building it.
I'm
> happy to say that I just now built it for Windows Phone 8.1 on a Visual Studio
12
> 2013 system and it compiles and creates the resulting libs like a pro:
>
> <command>
> b2 toolset=msvc-12.0 windows-api=phone architecture=arm link=static
--with-math
> variant=debug debug-store=database debug-symbols=on pch=off cxxflags=-ZW
> stage </command>
>
> Libraries created:
>
> (*) libboost_math_tr1-vc120-mt-gd-1_58.lib
> (*) libboost_math_tr1f-vc120-mt-gd-1_58.lib
> (*) libboost_math_c99-vc120-mt-gd-1_58.lib
> (*) libboost_math_c99f-vc120-mt-gd-1_58.lib
>
> The only warning message received, and there are many of these, is LNK4264:
>
> <snippet>
> msvc.archive bin.v2\libs\math\build\...\libboost_math_tr1-vc120-mt-gd-1_58.lib
> bin.v2\libs\math\build\...\sph_neumann.obj : warning LNK4264: archiving object
file
> compiled with /ZW into a static library; note that when authoring Windows
Runtime
> types it is not recommended to link with a static library that contains
Windows
> Runtime metadata bin.v2\libs\math\build\...\sph_legendre.obj : warning
LNK4264:
> archiving object file compiled with /ZW into a static library; note that when
> authoring Windows Runtime types it is not recommended to link with a static
library
> that contains Windows Runtime metadata
bin.v2\libs\math\build\...\sph_bessel.obj :
> warning LNK4264: archiving object file compiled with /ZW into a static
library; note
> that when authoring Windows Runtime types it is not recommended to link with a
> static library that contains Windows Runtime metadata . . .
> bin.v2\libs\math\build\...\beta.obj : warning LNK4264: archiving object file
compiled
> with /ZW into a static library; note that when authoring Windows Runtime types
it is
> not recommended to link with a static library that contains Windows Runtime
> metadata bin.v2\libs\math\build\...\assoc_legendre.obj : warning LNK4264:
> archiving object file compiled with /ZW into a static library; note that when
> authoring Windows Runtime types it is not recommended to link with a static
library
> that contains Windows Runtime metadata
> bin.v2\libs\math\build\...\assoc_laguerre.obj : warning LNK4264: archiving
object
> file compiled with /ZW into a static library; note that when authoring Windows
> Runtime types it is not recommended to link with a static library that
contains
> Windows Runtime metadata common.copy stage\lib\libboost_math_tr1-vc120-mt-
> gd-1_58.lib
> bin.v2\libs\math\build\...\libboost_math_tr1-vc120-mt-gd-1_58.lib
> 1 file(s) copied.
> </snippet>
>
> I encountered many of these warnings when building my ported libraries. The
online
> documentation seems to indicate that this is a recommendation. I can tell you
that
> the ported libraries, with these warnings, all function correctly with no
problems.
>
> In short, it looks like Boost.Math compiles as-is for Windows Phone 8.1.

Wonderful!

(Your success also suggests that many other Boost libraries will port
painlessly).

Thanks for your work on this.

Paul

PS I have read MS and other discussions of the warning LNK4264.

from https://msdn.microsoft.com/en-us/library/windows/apps/hh771041.aspx I
conclude that this is the key clause

"You can safely ignore the warning only if the static library is not producing
Windows Runtime components that are consumed outside the library itself."

There is a lot of other discussions, for example

http://stackoverflow.com/questions/14833852/porting-cross-platform-c-libraries-t
o-windows-phone-8-platform

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk