keil中编译stdint.h报错 identifier "__int8" is undefined

kobesdu 2014-08-27 05:12:08
RT

建立的工程里包含stdint.h这个文件。但是编译是报错。。。
类似的错误很多。但是这个文件是我网上下载的,为什么会有问题?

..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(69): error: #20: identifier "__int8" is undefined
typedef __int8 int8_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(70): error: #20: identifier "__int16" is undefined
typedef __int16 int16_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(71): error: #20: identifier "__int32" is undefined
typedef __int32 int32_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(73): error: #65: expected a ";"
typedef unsigned __int8 uint8_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(74): error: #65: expected a ";"
typedef unsigned __int16 uint16_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(75): error: #65: expected a ";"
typedef unsigned __int32 uint32_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(83): error: #20: identifier "uint8_t" is undefined
typedef uint8_t uint_least8_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(84): error: #20: identifier "uint16_t" is undefined
typedef uint16_t uint_least16_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(85): error: #20: identifier "uint32_t" is undefined
typedef uint32_t uint_least32_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(93): error: #20: identifier "uint8_t" is undefined
typedef uint8_t uint_fast8_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(94): error: #20: identifier "uint16_t" is undefined
typedef uint16_t uint_fast16_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stdint.h(95): error: #20: identifier "uint32_t" is undefined
typedef uint32_t uint_fast32_t;
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stm32f4xx_wwdg.h(85): error: #20: identifier "uint32_t" is undefined
void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stm32f4xx_wwdg.h(86): error: #20: identifier "uint8_t" is undefined
void WWDG_SetWindowValue(uint8_t WindowValue);
..\Libraries\STM32F4xx_StdPeriph_Driver\inc\stm32f4xx_wwdg.h(88): error: #20: identifier "uint8_t" is undefined
...全文
2494 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dceacho 2014-08-30
  • 打赏
  • 举报
回复 1
检查下stdint.h是不是重复包含了
kobesdu 2014-08-29
  • 打赏
  • 举报
回复
引用 1 楼 of123 的回复:
加上 typedef char __int8; typedef unsigned char __uint8; typedef short __int16; typedef unsigned short __uint16; typedef int __int32; typedef unsigned int __uint32;
谢谢~ 可是我加上之后,这几句报错。错误有 cannot conbine with previous“ char ”declaration specifier declaration does declared anything。。。 是我有什么头文件没有包含吗?
of123 2014-08-29
  • 打赏
  • 举报
回复
加上 typedef char __int8; typedef unsigned char __uint8; typedef short __int16; typedef unsigned short __uint16; typedef int __int32; typedef unsigned int __uint32;
kobesdu 2014-08-29
  • 打赏
  • 举报
回复
引用 3 楼 of123 的回复:
试试 typedef signed char __int8; 要是还报错,那就要怀疑编译器了。
好的,谢谢! 我用的是 keil uvision 5,不知道是不是不合适。
of123 2014-08-29
  • 打赏
  • 举报
回复
试试 typedef signed char __int8; 要是还报错,那就要怀疑编译器了。

27,383

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 单片机/工控
社区管理员
  • 单片机/工控社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧