这种错误是由于stm32函数库版本问题引起

2024-08-21 02:48

本文主要是介绍这种错误是由于stm32函数库版本问题引起,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

这种错误是由于stm32函数库版本问题引起 

#include <stm32f10x_lib.h> 是旧版的 头文件

#include "stm32f10x.h"  是新版的头文件

把他们互换就好了。


compiling core_cm3.c...

compiling system_stm32f10x.c...
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef signed long  s32;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                        ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef signed long  const sc32;  /* Read Only */
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                              ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile signed long  vs32;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                 ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile signed long  const vsc32;  /* Read Only */
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                       ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef unsigned long  u32;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                          ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef unsigned long  const uc32;  /* Read Only */
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile unsigned long  vu32;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                   ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile unsigned long  const vuc32;  /* Read Only */
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                         ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                            ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                          ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                                      ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                              ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of "..\CMSIS\stm32f10x.h")
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                                 ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                            ^
E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 524 of "..\CMSIS\stm32f10x.h")

E:\Program Files\KeilARM\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;


互换后:

.\main.c(2): #include "stm32f10x.h" //#include "stm32f10x_lib.h"  
.\stm32f10x_it.h(23): #include "stm32f10x.h" //#include "stm32f10x_lib.h"
.\Functions\AppProc.c(10): #include "stm32f10x.h" //#include <stm32f10x_lib.h>
.\Functions\buzzer.c(10): #include "stm32f10x.h" //#include <stm32f10x_lib.h>               
.\Functions\Delay.c(1): #include "stm32f10x.h" //#include "stm32f10x_lib.h"
.\Functions\Display.c(10): #include "stm32f10x.h" //#include <stm32f10x_lib.h>
.\Functions\EEPRom.c(1): #include "stm32f10x.h" //#include <stm32f10x_lib.h>               
.\Functions\HostUsart.c(10): #include "stm32f10x.h" //#include "stm32f10x_lib.h" 
.\Functions\IO4094.c(1): #include "stm32f10x.h" //#include <stm32f10x_lib.h>  
.\Functions\KeyProc.c(10): #include "stm32f10x.h" //#include <stm32f10x_lib.h>
.\Functions\Keyscanf.c(1): #include "stm32f10x.h" //#include <stm32f10x_lib.h>
.\Functions\Memory.c(1): #include "stm32f10x.h" //#include <stm32f10x_lib.h>               

这篇关于这种错误是由于stm32函数库版本问题引起的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1091903

相关文章

usb接口驱动异常问题常用解决方案

《usb接口驱动异常问题常用解决方案》当遇到USB接口驱动异常时,可以通过多种方法来解决,其中主要就包括重装USB控制器、禁用USB选择性暂停设置、更新或安装新的主板驱动等... usb接口驱动异常怎么办,USB接口驱动异常是常见问题,通常由驱动损坏、系统更新冲突、硬件故障或电源管理设置导致。以下是常用解决

Mysql如何解决死锁问题

《Mysql如何解决死锁问题》:本文主要介绍Mysql如何解决死锁问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录【一】mysql中锁分类和加锁情况【1】按锁的粒度分类全局锁表级锁行级锁【2】按锁的模式分类【二】加锁方式的影响因素【三】Mysql的死锁情况【1

SpringBoot内嵌Tomcat临时目录问题及解决

《SpringBoot内嵌Tomcat临时目录问题及解决》:本文主要介绍SpringBoot内嵌Tomcat临时目录问题及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录SprinjavascriptgBoot内嵌Tomcat临时目录问题1.背景2.方案3.代码中配置t

SpringBoot使用GZIP压缩反回数据问题

《SpringBoot使用GZIP压缩反回数据问题》:本文主要介绍SpringBoot使用GZIP压缩反回数据问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录SpringBoot使用GZIP压缩反回数据1、初识gzip2、gzip是什么,可以干什么?3、Spr

Windows Docker端口占用错误及解决方案总结

《WindowsDocker端口占用错误及解决方案总结》在Windows环境下使用Docker容器时,端口占用错误是开发和运维中常见且棘手的问题,本文将深入剖析该问题的成因,介绍如何通过查看端口分配... 目录引言Windows docker 端口占用错误及解决方案汇总端口冲突形成原因解析诊断当前端口情况解

如何解决idea的Module:‘:app‘platform‘android-32‘not found.问题

《如何解决idea的Module:‘:app‘platform‘android-32‘notfound.问题》:本文主要介绍如何解决idea的Module:‘:app‘platform‘andr... 目录idea的Module:‘:app‘pwww.chinasem.cnlatform‘android-32

kali linux 无法登录root的问题及解决方法

《kalilinux无法登录root的问题及解决方法》:本文主要介绍kalilinux无法登录root的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,... 目录kali linux 无法登录root1、问题描述1.1、本地登录root1.2、ssh远程登录root2、

SpringBoot应用中出现的Full GC问题的场景与解决

《SpringBoot应用中出现的FullGC问题的场景与解决》这篇文章主要为大家详细介绍了SpringBoot应用中出现的FullGC问题的场景与解决方法,文中的示例代码讲解详细,感兴趣的小伙伴可... 目录Full GC的原理与触发条件原理触发条件对Spring Boot应用的影响示例代码优化建议结论F

MySQL 中查询 VARCHAR 类型 JSON 数据的问题记录

《MySQL中查询VARCHAR类型JSON数据的问题记录》在数据库设计中,有时我们会将JSON数据存储在VARCHAR或TEXT类型字段中,本文将详细介绍如何在MySQL中有效查询存储为V... 目录一、问题背景二、mysql jsON 函数2.1 常用 JSON 函数三、查询示例3.1 基本查询3.2

Pyserial设置缓冲区大小失败的问题解决

《Pyserial设置缓冲区大小失败的问题解决》本文主要介绍了Pyserial设置缓冲区大小失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录问题描述原因分析解决方案问题描述使用set_buffer_size()设置缓冲区大小后,buf