keil 4.22 MDK 建工程时出现的重定义错误

在更新STM32官方库至3.5版后,在Keil 4.22中创建工程时遇到重定义错误,如's32'、'FlagStatus'等类型。错误主要源于头文件重复声明。解决方法是在官方提供的函数库头文件路径下添加stm32f10x_conf.h文件,并从指定链接下载。完成添加后重新编译工程,问题通常可以得到解决。其他可能的错误原因可以参考相关技术文章。
摘要由CSDN通过智能技术生成

在更新官方的STM32 官方库3.5版本的函数库后,建立工程时会出现诸多重定义错误,例如:

D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of ".\CM3\stm32f10x.h")
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
D:\Keil2\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值