1

I installed Visual Studio 2015 Professional edition today and created a C++ Win32 console application

Then I want to use C++ REST SDK (Casablanca), so I downloaded it v14 using NuGet package manager And created a sample program using this link

However, when I compiled, I am getting errors in VS includes..

enter image description here

Clicked on first error, it takes to here

enter image description here

Can't understand why VS includes are failing compilation. So, I created another project and just put "hello world" and it worked fine

Please help

Edit: Pasting error test

1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(100): error C2737: 'std::is_same_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(100): error C2998: 'const bool std::is_same_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(245): error C2737: 'std::is_integral_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(245): error C2998: 'const bool std::is_integral_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(282): error C2737: 'std::is_floating_point_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(282): error C2998: 'const bool std::is_floating_point_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(295): error C2737: 'std::is_arithmetic_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(295): error C2998: 'const bool std::is_arithmetic_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef(697): error C2737: 'std::is_function_v': 'constexpr' object must be initialized
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef(697): error C2998: 'const bool std::is_function_v': cannot be a template definition
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1113): error C3861: '__builtin_huge_valf': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1118): error C3861: '__builtin_nanf': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1123): error C3861: '__builtin_nansf': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1176): error C3861: '__builtin_huge_val': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1181): error C3861: '__builtin_nan': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1186): error C3861: '__builtin_nans': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1239): error C3861: '__builtin_huge_val': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1244): error C3861: '__builtin_nan': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\limits(1249): error C3861: '__builtin_nans': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(524): error C2275: '_To': illegal use of this type as an expression
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(521): note: see declaration of '_To'
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(526): note: see reference to class template instantiation 'std::is_assignable<_To,_From>' being compiled
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(524): error C2275: '_From': illegal use of this type as an expression
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(522): note: see declaration of '_From'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(524): error C3861: '__is_assignable': identifier not found
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(524): error C2975: '_Val': invalid template argument for 'std::integral_constant', expected compile-time constant expression
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\xtr1common(21): note: see declaration of '_Val'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1245): error C2061: syntax error: identifier '__make_integer_seq'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1249): error C2065: '_Vals': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1249): error C2975: '_Vals': invalid template argument for 'std::integer_sequence', expected compile-time constant expression
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1190): note: see declaration of '_Vals'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1252): error C2061: syntax error: identifier 'make_integer_sequence'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1261): error C2631: 'identity': a class or enum cannot be defined in an alias template
1>c:\users\arunav\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1\stdafx.cpp : fatal error C1903: unable to recover from previous error(s); stopping compilation
Cœur
  • 37,241
  • 25
  • 195
  • 267
SimpleGuy
  • 2,764
  • 5
  • 28
  • 45
  • http://stackoverflow.com/help/mcve – Hans Passant Aug 03 '16 at 15:23
  • @HansPassant Just including the header cause above errors `#include #include ` – SimpleGuy Aug 03 '16 at 15:26
  • It may help to copy the text of the error messages to the question from the output window you have shown in the picture. In the current form we can't see the actual errors since that part is cutoff. If this text is long maybe just the first few errors. – drescherjm Aug 03 '16 at 15:27
  • Does the Casablanca source code inadvertently `#define` or erroneously restore the `_HAS_VARIABLE_TEMPLATES` preprocessor symbol? – IInspectable Aug 03 '16 at 15:39
  • @IInspectable Atleast the search does not show it – SimpleGuy Aug 03 '16 at 15:43
  • @IInspectable Can you answer this http://stackoverflow.com/questions/38748498/alternatives-to-c-rest-casablanca-for-windows-using-visual-studio-2015 – SimpleGuy Aug 03 '16 at 16:02
  • Have you installed Update 3 for Visual Studio 2015? To verify, go to *Configuration Properties* → *C/C++* → *General* and set the *Suppress Startup Banner* option to *"No"*. Build the solution again. The compiler version for Update 3 should be reported as 19.00.24213.1 (or maybe 19.00.24210.0). – IInspectable Aug 03 '16 at 16:03
  • @IInspectable Help > About Visual Studio and I see Version 14.0.25425.01 Update 3 – SimpleGuy Aug 03 '16 at 16:06
  • @IInspectable Built by setting Suppress Startup Banner option to "No"., failed again – SimpleGuy Aug 03 '16 at 16:07
  • It wasn't meant to fix the issue. Setting the option to *"No"* allows you to take note of the compiler used to compile the code from the *Output* window. What version did it report? – IInspectable Aug 03 '16 at 16:10
  • @IInspectable Sorry. It gave this `Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x64` – SimpleGuy Aug 03 '16 at 16:19
  • That's not Update 3. Looks more like Visual Studio 2015 RC. Had you installed the Release Candidate? Did you fail to properly uninstall it prior to installing the RTM? – IInspectable Aug 03 '16 at 16:22
  • @IInspectable I actually downloaded it from torrent (en_visual_studio_professional_2015_x86_x64_dvd_6846629.iso). Is it possible for me to use express version of 2015 ? – SimpleGuy Aug 03 '16 at 16:32
  • 1
    You could use the [Express Edition](https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx), but noone does anymore, since the [Community Editions](https://www.visualstudio.com/products/visual-studio-community-vs) have been published. Still free, but almost the feature set of the Professional version. – IInspectable Aug 03 '16 at 16:35
  • @IInspectable I will install Community edition and get back to you. Thanks – SimpleGuy Aug 03 '16 at 16:38
  • 1
    Make sure you **fully** uninstall your version of Visual Studio 2015 first. Use a tool like [Visual Studio Uninstaller](https://github.com/Microsoft/VisualStudioUninstaller/releases) to make this more reliable. Note: This tool will install Visual Studio 2013 as well. If you have Visual Studio 2013 and want to keep it, look for another solution. – IInspectable Aug 03 '16 at 16:46
  • @IInspectable Thanks – SimpleGuy Aug 03 '16 at 16:52
  • @IInspectable It worked !!!!!! Installed VS Community 2015 with Update 3. Installed Casablanca from NuGet. Created sample program mentioned above and it worked like a charm. Thanks for all the help !! – SimpleGuy Aug 04 '16 at 12:31

1 Answers1

1

I installed Visual Studio Community Edition 2015. After that I installed Casablanca from NuGet. And all worked. I seems that the installation was corrupted / was a RC, as

Casablanca Version --> cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.8.0

SimpleGuy
  • 2,764
  • 5
  • 28
  • 45