使用keil 5出现大量错误:error: #20: identifier "size_t" is undefined

error: #20: identifier "size_t" is undefined

D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(223): error: #20: identifier “size_t” is undefined
size_t mbsnrtowcs(wchar_t * __restrict /dst/,
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(225): error: #20: identifier “size_t” is undefined
size_t /nmb/,
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(226): error: #20: identifier “size_t” is undefined
size_t /len/, mbstate_t * __restrict /ps/) attribute((nonnull(2)));
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(227): error: #20: identifier “size_t” is undefined
size_t wcsnrtombs(char * __restrict /dst/,
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(229): error: #20: identifier “size_t” is undefined
size_t /nwc/,
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(230): error: #20: identifier “size_t” is undefined
size_t /len/, mbstate_t * __restrict /ps/) attribute((nonnull(2)));
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(257): error: #20: identifier “size_t” is undefined
const wchar_t * __restrict /s2/, size_t /n/) attribute((nonnull(1,2)));
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(259): error: #20: identifier “size_t” is undefined
const wchar_t * __restrict /s2/, size_t /n/) attribute((nonnull(1,2)));
D:\Software\Keil_v5\ARM\ARMCC\Bin…\include\wchar.h(261): error: #20: identifier “size_t” is undefined
const wchar_t * __restrict /s2/, size_t /n/) attribute((nonnull(1,2)));
…\HARDWARE\w25qxx.c: 0 warnings, 30 errors
“…\OBJ\demo.axf” - 270 Error(s), 0 Warning(s).

原因:
罪恶之源
改为#include"string.h" 即可

你可能感兴趣的:(STM32)