***stm32f10x_type.h(23): error: #256: invalid redeclaration of type name "s32" 原因+解决方案

Build target 'USART_Base'

compiling main.c...
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h")
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\STM32开发板资料\STM32开发板资料\工具软件\MDK3.50\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope

。。。。。。。。。。。。。。。。。。。。。。。。。。。。

。。。。。。。。。。。。。。。。。


编译器报错原因:编译器在****/stm32f10x_type.h这里找不到“s32”等的声明。  因为之前有改变 项目目录,导致使用的V3.5版本的固件库中的stm32f10x_type.h类型定义文件,编译器在  用户的MDK固件库配置路径  中找不到了,于是编译器就使用了MDK自带固件库(版本V2.0.1)的stm32f10x_type.h文件,于是问题来了-----版本不一致,不兼容。。。


解决方法:

修改用户的MDK固件库配置路径:




其中,我的项目目录:D:\ARM\workSpace\USART\USART_Base




  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值