Visual Studio 2015:C++ REST API (Casablanca) 在 VS 中编译失败 includes/headers
Visual Studio 2015: C++ REST API (Casablanca) failing compilation in VS includes/headers
我今天安装了Visual Studio2015专业版并创建了一个C++ Win32控制台应用程序
然后我想使用 C++ REST SDK (Casablanca),所以我使用 NuGet 包管理器下载了 v14 并使用 this link
创建了一个示例程序
但是,当我编译时,我在 VS includes 中遇到错误..
点击第一个错误,跳转到这里
无法理解为什么 VS 包含编译失败。
所以,我创建了另一个项目,然后放入 "hello world",它工作正常
请帮忙
编辑:粘贴错误测试
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
我安装了 Visual Studio Community Edition 2015。之后我从 NuGet 安装了 Casablanca。一切都奏效了。我似乎安装已损坏/是一个 RC,因为
卡萨布兰卡版本 --> cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.8.0
我今天安装了Visual Studio2015专业版并创建了一个C++ Win32控制台应用程序
然后我想使用 C++ REST SDK (Casablanca),所以我使用 NuGet 包管理器下载了 v14 并使用 this link
创建了一个示例程序但是,当我编译时,我在 VS includes 中遇到错误..
点击第一个错误,跳转到这里
无法理解为什么 VS 包含编译失败。 所以,我创建了另一个项目,然后放入 "hello world",它工作正常
请帮忙
编辑:粘贴错误测试
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
我安装了 Visual Studio Community Edition 2015。之后我从 NuGet 安装了 Casablanca。一切都奏效了。我似乎安装已损坏/是一个 RC,因为
卡萨布兰卡版本 --> cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.8.0