Boost logo

Boost Users :

Subject: [Boost-users] Windows 10 and VC14, fixing C2117 error when using Asio.
From: Andrew Maclean (andrew.amaclean_at_[hidden])
Date: 2016-05-20 20:17:38


If you find that when using Asio in Windows 10 with the Windows 10 SDK and
Visual Studio 2015 you get lots of C2177 errors in winnt.h and sdkdkver.h
then this should fix it:

Essentially, just add:

#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00

before any header that includes SDKDDKVer.h either directly or indirectly.

If using CMake, then in the CMakeLists.txt file just add these lines:
if(WIN32)
  add_definitions(-DWINVER=0x0A00)
  add_definitions(-D_WIN32_WINNT=0x0A00)
endif()

The fix is documented at
https://msdn.microsoft.com/en-us/library/6sehtctf.aspx

I hope this helps others.

Regards
   Andrew

-- 
___________________________________________
Andrew J. P. Maclean
___________________________________________


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