刚开始安装的是MDK4.7,但是按照视频上编译显示错误 缺少crtdefs.h这个头文件,就下载了一个。再编译就出现了好多错误:在stdio.h文件中,出现类似这样的错误:
Build target 'Target 1'
compiling test.c...
..\SYSTEM\sys\stdio.h(186): error: #77-D: this declaration has no storage class or type specifier
..\SYSTEM\sys\stdio.h(186): error: #65: expected a ";"
..\SYSTEM\sys\stdio.h(187): error: #77-D: this declaration has no storage class or type specifier
..\SYSTEM\sys\stdio.h(187): error: #65: expected a ";"
..\SYSTEM\sys\stdio.h(189): error: #757: variable "_Check_return_" is not a type name
..\SYSTEM\sys\stdio.h(189): error: #101: "FILE" has already been declared in the current scope
对应的代码:
#ifndef _STDIO_DEFINED
_Check_return_ _CRTIMP int __cdecl _filbuf(_Inout_ FILE * _File );
_Check_return_opt_ _CRTIMP int __cdecl _flsbuf(_In_ int _Ch, _Inout_ FILE * _File);
_Check_return_ _CRTIMP FILE * __cdecl _fsopen(_In_z_ const char * _Filename, _In_z_ const char * _Mode, _In_ int _ShFlag);
_CRTIMP void __cdecl clearerr(_Inout_ FILE * _File);
#if __STDC_WANT_SECURE_LIB__
_Check_return_wat_ _CRTIMP errno_t __cdecl clearerr_s(_Inout_ FILE * _File );
#endif /* __STDC_WANT_SECURE_LIB__ */
*******************************************************
好像是针对_Check_return_报的错误
这个问题昨晚上就出现了,我弄了半天也没弄好,以为是stdio的问题,重新下载了一个也没用。求大家帮忙解决一下,多谢
|