Problem using REST SDK in Windows desktop app built with VS2015 (with and without NuGet)

Jun 1, 2015 at 10:57 PM
Hi All,

While switching our Windows desktop (and later other platforms) product from Boost ASIO to REST SDK, I'm having trouble figuring out how to build it with Visual Studio 2015 RC.

I've cloned Casablanca git repo and have successfully built it with VS2015 using cpprestsdk140.sln.
But when I tried including REST SDK headers into our app and build with VS2015, I got tons of errors like this (building with VS2013 works fine):
error C2039: 'websocket_client': is not a member of 'web::websockets::client'

Apparently the problem is caused by an ifdef in the beginning of the header, which checks:
_MSC_VER < 1900
Am I tracking a wrong branch? But how then cpprestsdk140.sln manages to build everything???.

But the most bizarre thing is that, when I add REST SDK to VS2015 project with NuGet, the headers in ...\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.5.0\build\native\include\cpprest\ws_client.h
contain the same _MSC_VER < 1900 check, making them unusable in VS2015!
Is this a bug in NuGet packages or am I missing some defines in VS project settings?

Looking forward to solving this mystery...
Jun 2, 2015 at 1:22 AM
Hi Boris,

The 2.5.0 release only contains binaries for VS 2015 Preview, not RC. That is why the NuGet package doesn't work with RC. Our next release 2.6.0 will update our NuGet package for binaries for RC. I estimate the release will probably be out tomorrow.

Until then you can build from source for VS 2015 RC yourself if you want. You need to build from the 'development' branch instead of the 'master' as it contains the changes necessary.

Jun 2, 2015 at 3:57 PM
Switching to 'development' branch worked!
Thanks for your help,
Jun 3, 2015 at 1:10 AM
Hi Boris,

FYI the 2.6.0 release is out now with support for VS2015. You can switch back to using the NuGet package if you'd like.