即使是用/ clr编译的干净的空dll项目,也仅包含一个cpp文件,
#include <cliext/vector>
没什么,编译器会喷出
1>------ Build started: Project: test1, Configuration: Debug x64 ------
1>Source.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3331,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3352): message : see reference to class template instantiation 'cliext::BCL_reference<_Cont_t,_Is_ref>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3332,1): error C2805: binary 'operator =' has too few parameters
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3332,1): error C2333: 'cliext::BCL_reference<_Cont_t,_Is_ref>::operator =': error in function declaration; skipping function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3340,1): error C2833: 'operator value_type' is not a recognized operator or type
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3341,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3351,1): error C3646: '_Myval': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3351,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(872,1): error C2833: 'operator _Mycont_it' is not a recognized operator or type
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1083): message : see reference to class template instantiation 'cliext::impl::vector_base<_Value_t,_Is_ref>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(872,1): error C2059: syntax error: 'newline'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(873,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(878,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(878,1): error C2535: 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(856): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(883,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(883,1): error C2535: 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(856): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(894,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(894,1): error C2535: 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(856): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(946,1): error C2061: syntax error: identifier 'iterator'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(953,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(960,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(962,1): error C2535: 'void cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(953): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(971,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(973,1): error C2535: 'void cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(953): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(991,1): error C3646: 'size_type': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(991,1): error C3646: 'Count_generic': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(992,3): error C2059: syntax error: '{'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(991,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1010,1): error C2061: syntax error: identifier '_Myarray_t'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1026,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1038,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1048,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1061,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1072,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1129,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1149): message : see reference to class template instantiation 'cliext::impl::vector_select<_Value_t,_Is_ref>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1129,1): error C2535: 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1112): message : see declaration of 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1134,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1134,1): error C2535: 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1112): message : see declaration of 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1145,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1145,1): error C2535: 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1112): message : see declaration of 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1194,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1306): message : see reference to class template instantiation 'cliext::impl::vector_select<_Value_t,true>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1194,1): error C2535: 'cliext::impl::vector_select<_Value_t,true>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1177): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1199,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1199,1): error C2535: 'cliext::impl::vector_select<_Value_t,true>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1177): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1210,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1210,1): error C2535: 'cliext::impl::vector_select<_Value_t,true>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1177): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1216,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1223,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1224,1): error C2535: 'void cliext::impl::vector_select<_Value_t,true>::resize(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1216): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::resize'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1229,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,1): error C3646: 'value_type': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,1): error C3646: 'default': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,29): error C2143: syntax error: missing ',' before '['
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1245,1): error C2143: syntax error: missing ')' before ';'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1245,1): error C2059: syntax error: ')'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1245,1): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1291,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1296,1): error C3646: 'insert': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1296,17): error C2059: syntax error: '('
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1297,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1301,1): error C2061: syntax error: identifier 'iterator'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1363,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1395): message : see reference to class template instantiation 'cliext::vector<_Value_t>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1363,1): error C2535: 'cliext::vector<_Value_t>::vector(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1335): message : see declaration of 'cliext::vector<_Value_t>::vector'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1368,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1368,1): error C2535: 'cliext::vector<_Value_t>::vector(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1335): message : see declaration of 'cliext::vector<_Value_t>::vector'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1379,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1379,1): error C2535: 'cliext::vector<_Value_t>::vector(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1335): message : see declaration of 'cliext::vector<_Value_t>::vector'
1>Done building project "test1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
所有最新版本的VS2017,VS2019和VS2019预览版都会发生这种情况。我很困惑。这似乎不是一个错误,因为它是比较古老且经过验证的标头,并且发生在不同的编译器中。
编辑:此处有超级duper完整代码(带有项目文件):https://gist.github.com/s9w/a65bf50ed928bd0d6629c1d10b013463
编辑:为将来的人们提供同样的帮助:它是/ permissive-开关(符合模式)-不适用于该标题。
答案 0 :(得分:1)
为了帮助以后的人们解决同样的问题:/ permissive-开关(符合性模式)-与该标头的配合不好。