标准Microsoft文件中的语法错误“iosfwd”&编译VS2008 soln时“atlconv.h”?

时间:2012-08-27 09:32:26

标签: c++ visual-studio visual-studio-2008 visual-c++

您好,我在标准的微软文件“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

这些只是我在这里粘贴的一些错误,因为我无法粘贴每个错误。但所有错误都在这两个文件ONLy(IOSFWD& atlconv.h“)中。

1 个答案:

答案 0 :(得分:0)

您通常可以假设随编译器一起提供的标头是正确的,特别是当它是常用的<iosfwd>时。但是,编译器有时会在包含它们之前发生错误时报告标准标头中的错误。例如,一个未关闭的命名空间或类,即一个缺失的}可以产生这种效果(这是我在你的情况下开始寻找的)或一个类定义后缺少的分号。