On Wed, Jun 13, 2012 at 07:03:01PM +0000, Davidson, Josh wrote:
Consider this following simple app:
#include
#include #include If asio.hpp is moved ahead of the thread headers, the error goes away. We've been trying to dictate #include order to work around this problem, but it keeps cropping up.
I've got an idea to the root cause here. The primitives like InterlockedExchange requires a minimum of XP/2003 support, so you need _WIN32_WINNT to be at least 0x501 in order to target a minimum OS version of XP. I believe that Asio defines _WIN32_WINNT to a sufficiently high value in order to get the OS primitives it needs, and as such, implicitly ensures that the thread code gets them too. Either Boost.Thread ought to also define this if it's not already defined, and probably error out hard with a nice message if it's not targetting a sufficiently fancy Windows version. -- Lars Viklund | zao@acc.umu.se