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