尝试使用 VS2019 构建最初的 VS2013 C++ 项目时 xtr1common 和 type_traits 中的错误

Posted

技术标签:

【中文标题】尝试使用 VS2019 构建最初的 VS2013 C++ 项目时 xtr1common 和 type_traits 中的错误【英文标题】:Errors in xtr1common and type_traits when trying to build a originally VS2013 C++ project using VS2019 【发布时间】:2020-09-07 06:02:30 【问题描述】:

我正在尝试将 Visual Studio 2013 的项目升级到 Visual Studio 2019。

当我使用 Visual Studio 2013 (v120) 和 Windwos SDK 8.1 版构建项目时,一切都很顺利。但是当我尝试更新到v142和Windwos SDK 10.0版本时,出现如下错误:

1>------ Build started: Project: Logger, Configuration: Release x64 ------
1>stdafx.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(158,28): error C2275: '_False': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(157): message : see declaration of '_False'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(158,36): error C2275: '_Next': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(157): message : see declaration of '_Next'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(158,43): error C2275: '_Rest': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(157): message : see declaration of '_Rest'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(158,53): error C3544: '_Rest': parameter pack expects a type template argument
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(160,2): error C3855: 'std::_Disjunction': template parameter '_First_value' is incompatible with the declaration
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(32,1): warning C4467: usage of ATL attributes is deprecated
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(163): message : see reference to class template instantiation 'std::integral_constant<bool,false>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(163): message : see reference to class template instantiation 'std::disjunction<_Traits...>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(32,1): error C2337: '[': attribute not found
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(32,5): error C2146: syntax error: missing ']' before identifier 'nodiscard'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(32,5): error C2143: syntax error: missing ';' before ']'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(32,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(32,1): error C2334: unexpected token(s) preceding ''; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(166,28): error C2275: '_Rest': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(165): message : see declaration of '_Rest'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(166,38): error C3544: '_Traits': parameter pack expects a type template argument
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(168,2): error C3855: 'std::disjunction': template parameter '_Traits' is incompatible with the declaration
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(168,2): error C2977: 'std::disjunction': too many template arguments
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\xtr1common(166): message : see declaration of 'std::disjunction'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(35,68): error C2275: '_Ty': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(34): message : see declaration of '_Ty'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(35,31): error C2923: '__make_integer_seq': '_Ty' is not a valid template type argument for parameter '_T'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(34): message : see declaration of '_Ty'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(35,31): error C2923: '__make_integer_seq': 'size_t' is not a valid template type argument for parameter '_T'
1>D:\dev\og_coltt\COLoggersST\stdafx.cpp : message : see declaration of 'size_t'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(41): message : see reference to alias template instantiation 'std::make_integer_sequence<size_t,_Size>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(53,27): error C2275: '_True': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(52): message : see declaration of '_True'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(53,34): error C2275: '_Next': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(52): message : see declaration of '_Next'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(53,41): error C2275: '_Rest': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(52): message : see declaration of '_Rest'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(53,51): error C3544: '_Rest': parameter pack expects a type template argument
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(55,2): error C3855: 'std::_Conjunction': template parameter '_First_value' is incompatible with the declaration
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(61,28): error C2275: '_Rest': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(60): message : see declaration of '_Rest'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(61,38): error C3544: '_Traits': parameter pack expects a type template argument
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(63,2): error C3855: 'std::conjunction': template parameter '_Traits' is incompatible with the declaration
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(63,2): error C2977: 'std::conjunction': too many template arguments
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(61): message : see declaration of 'std::conjunction'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85,25): error C2275: '_Ty2': illegal use of this type as an expression
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(84): message : see declaration of '_Ty2'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85,31): error C3544: '_Types': parameter pack expects a type template argument
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(88,2): error C3855: 'std::_Arg_types': template parameter '_Types' is incompatible with the declaration
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(88,2): error C2977: 'std::_Arg_types': too many template arguments
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...)>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...)>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) const>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) const>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile const>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile const>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) const &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) const &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile const &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile const &>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) const &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) const &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile const &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103,1): error C2955: 'std::_Arg_types': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(85): message : see declaration of 'std::_Arg_types'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(103): message : see reference to class template instantiation 'std::_Is_function<_Ret(_Types...) volatile const &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(138): message : see reference to class template instantiation 'std::_Is_memfunptr<_Ret(__vectorcall _Arg0::* )(_Types...) volatile const &&>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(138,1): fatal error C1003: error count exceeds 100; stopping compilation
1>Done building project "COLoggersST.vcxproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

如您所见,文件 xtr1common 和 type_traits 上有大量错误。当我使用 C++14 编译时,这两个文件都出现错误,但是当我使用 C++17 时,只有 type_traits 有错误。

我在这个项目中使用了大量的 ATL 编程。也许 2013 和 2019 版本会破坏一些 ATL 的东西?

在 stdafx.h 中,这是 ATL 标头:

#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <comdef.h>

提前感谢大家提供的任何见解。

【问题讨论】:

Compiler Error C2955.就我而言,一些库在 VS2019 中已被弃用,或者存在监管问题。恐怕你可以标准化自己的代码来解决问题。 【参考方案1】:

我通过删除编译器选项 /FX 解决了这个问题。

我认为出现此问题是因为 Visual Studio 尝试将 cpp 文件编译为 C 而不是 C++。

项目属性 -> C/C++ -> 输出文件 -> 将“扩展属性源”设置为“否”。

【讨论】:

【参考方案2】:

我在使用 Visual Studio 2019 重建 32 位 MFC/C++ 旧版应用程序时遇到了类似的问题,这个答案解决了这个问题。感谢 Marcus Bruno 发布解决方案。

这是我收到的许多几乎相同的错误消息之一:

xtr1common(158,28): error C2275: '_False': 非法使用这种类型作为表达式

请注意,这些错误是特定于 Win32 构建的,不会出现在 x64 上。

【讨论】:

以上是关于尝试使用 VS2019 构建最初的 VS2013 C++ 项目时 xtr1common 和 type_traits 中的错误的主要内容,如果未能解决你的问题,请参考以下文章

VS2013中使用ninja构建WebRTC并调试

DutchWorkz MSI 构建 VS Installers 插件无法看到 VS2019

构建在 VS 2013 中找不到 Platform Toolset = 'v141'

用于 VS2019 的 circa-2011 代码库的 FLTK 2.0 构建和演示

带有 vs2013 的 Windows 7 上的 Chromium 构建失败(警告为错误)

在构建容器应用程序时,VS2013无法识别添加的OCX控制方法