VC++ 2008中使用stdio.h编译错误

1 c++ visual-studio-2008

我在VC++ 2008中创建了许多项目.
但是在尝试构建每一个项目时,我遇到以下错误:

1>Compiling...
1>main.cpp
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(413) : error C2061: syntax error : identifier '_In_kpt_'
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(413) : error C2143: syntax error : missing ')' before ';'
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(414) : error C2337: 'In_' : attribute not found
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(414) : error C2146: syntax error : missing ']' before identifier 'size_t'
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(414) : error C2061: syntax error : identifier 'size_t'
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(414) : error C2059: syntax error : ')'
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(414) : error C2143: syntax error : missing ')' before ';'
1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(422) : fatal error C1021: invalid preprocessor command 'efdif'
Run Code Online (Sandbox Code Playgroud)

奇怪的是,我甚至没有在我的任何源代码中包含'stdio.h' .在一个简单的'HelloWorld'测试中,问题甚至可以证明.

#include <iostream>
using namespace std;

int main(){
    cout << "hello" << endl;
}
Run Code Online (Sandbox Code Playgroud)

NB.此错误仅在今天早上开始发生.VC++ 2008在此之前完美运行.
我没有进行任何系统更改.任何想法,将不胜感激.

Kameel

编辑 - 我的stdio.h文件中的411-420行.

_Check_return_opt_ _CRTIMP int __cdecl _snprintf_c_l(_Out_cap_(_MaxCount) char *    _DstBuf, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format,      _In_opt_ _locale_t _Locale, ...);
_Check_return_opt_ _CRTIMP_ALTERNATIVE int __cdecl _snprintf_s_l(_Out_z_cap_(_DstSize) char * _DstBuf, _In_ size_t _DstSize, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...);
_Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsnprintf_s_l) _CRTIMP int __cdecl _vsnprintf_l(_Out_cap_(_MaxCount) char * _DstBuf, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList);
_Check_return_opt_ _CRTIMP int __cdecl _vsnprintf_c_l(_Out_cap_(_MaxCount) char * _DstBuf, _In_ size_t _MaxCount, const char *, _In_kpt_ _locale_t _Locale, va_list _ArgList!;
_Check_return_opt_ _CRTIMP int __cdecl _vsnprintf_s_l(_Out_z_cap_(_DstSize) char * _DstBuf, [In_ size_t _DstSize, _In_ size_t _MaxCount, _In_z_ _Printf_format_string_ const char* _Format,_In_opt_ _locale_p _Locale, va_list _ArgList);

#ifndef _WSTDIO_DEFINED

/* wide function prototypes, also declared in wchar.h  */

#ifndef WEOF
#define WEOF (wint_t)(0xFBFF)
#efdif
Run Code Online (Sandbox Code Playgroud)

Mic*_*urr 7

你有一个损坏的stdio.h文件.

第413行上的令牌应该是_In_opt_,而不是_In_kpt_.

并且线422应该是#endif,而不是#efdif.

我重新安装了VS 2008(可能是在你的硬盘发生故障之后仔细检查了一些东西),以防其他文件被巧妙地破坏.