Boost logo

Boost Users :

Subject: Re: [Boost-users] How to compile boost-thread for Universal Windows?
From: John Maddock (jz.maddock_at_[hidden])
Date: 2016-12-19 04:29:00


On 18/12/2016 17:28, Petr Hudeček wrote:
> Hello,
> I'm trying to use the boost-thread library in a Windows Runtime (UWP)
> project. The tutorial at
> https://blogs.msdn.microsoft.com/vcblog/2014/07/18/using-boost-libraries-in-windows-store-and-phone-applications/
> doesn't seem to work anymore.
>
> If I compile boost sources, either from the primary distribution, or
> from https://github.com/wpbest/Boost, I can compile it as a static
> library but when I link to it from the project, I receive linker
> errors that four identifiers could not be found. These identifiers are
> API functions such as CreateWaitableTimer.
>
> Is there a way to use boost-thread from a UWP project despite this?
> Perhaps setting some preprocessor symbols?

Looks like Boost.Thread uses BOOST_PLAT_WINDOWS_RUNTIME for this, which
is set by Predef according to the value of WINAPI_FAMILY - so if I'm
reading this correctly, you shouldn't get those errors if the library
really is compiled against the universal runtime.

BTW if I was doing this, I would just define BOOST_ALL_NO_LIB and then
either:

* Add the thread lib source direct to my app, or
* Add the thread lib source to a static lib project in the IDE and
reference it from the apps that need it.

IMO it's easier to keep build options all in synch this way.... but
that's just me.

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net