1

嗨,我在标准 microsoft 文件“iosfwd”和 atlconv.h“中遇到了很多语法错误。(我在下面粘贴了一些错误):: 真的不明白标准文件 iosfwd 和 atlconv.h 中此类错误背后的原因。任何非常感谢您的帮助。

IOSFWD 中的错误

\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(350) : error C2065: '_Size_in_words' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(350) : error C2065: '_First2' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(350) : error C2065: '_Count' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(350) : error C3861: '_CRT_SECURE_WMEMCPY': identifier not found
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(351) : error C2065: '_First1' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(358) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(358) : error C2146: syntax error : missing ')' before identifier '_Elem'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(358) : error C2059: syntax error : ')'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(358) : error C2059: syntax error : ')'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(366) : error C2065: '_First1' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\include\iosfwd(366) : error C2065: '_Count' : undeclared identifier

atlconv.h 中的错误::

program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(530) : error C2146: syntax error : missing ')' before identifier 'LPDEVMODEA'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(530) : warning C4229: anachronism used : modifiers on data are ignored
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(530) : error C2495: 'AtlDevModeW2A' : '__declspec(nothrow)' can only be applied to function declarations or definitions
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(530) : error C2059: syntax error : ')'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C2065: 'nChars' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C2448: '_Ret_opt_z_cap_' : function-style initializer appears to be a function definition
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C2143: syntax error : missing ';' before '__stdcall'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C2065: 'nChars' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C3861: '_Out_z_cap_': identifier not found
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C2146: syntax error : missing ')' before identifier 'LPWSTR'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : warning C4229: anachronism used : modifiers on data are ignored
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(535) : error C2059: syntax error : ')'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(536) : error C2143: syntax error : missing ';' before '{'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C2065: 'nChars' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C2448: '_Ret_opt_z_cap_' : function-style initializer appears to be a function definition
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C2143: syntax error : missing ';' before '__stdcall'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C2065: 'nChars' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C3861: '_Out_z_cap_': identifier not found
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C2146: syntax error : missing ')' before identifier 'LPSTR'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : warning C4229: anachronism used : modifiers on data are ignored
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(554) : error C2059: syntax error : ')'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(555) : error C2143: syntax error : missing ';' before '{'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C2065: 'nChars' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C2448: '_Ret_opt_z_cap_' : function-style initializer appears to be a function definition
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C2143: syntax error : missing ';' before '__stdcall'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C2065: 'nChars' : undeclared identifier
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C3861: '_Out_z_cap_': identifier not found
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C2146: syntax error : missing ')' before identifier 'LPWSTR'
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : warning C4229: anachronism used : modifiers on data are ignored
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\atlconv.h(572) : error C2374: 'AtlA2WHelper' : redefinition; multiple initialization

这些只是我在此处粘贴的一些错误,因为我无法粘贴每个错误。但是所有错误都只在这 2 个文件中(IOSFWD 和 atlconv.h")。

4

1 回答 1

0

您通常可以假设编译器附带的头文件是正确的,尤其是当它是一个经常使用的头文件时,例如<iosfwd>. 但是,编译器有时会在包含标准头文件之前出现错误时报告错误。例如,一个未封闭的命名空间或类,即缺少}可能会产生这种效果(这就是我在你的情况下开始寻找的)或在类定义之后缺少分号。

于 2012-08-27T10:41:23.777 回答