USE_STDPERIPH_DRIVER, STM32F10X_HD
compiling stm32f10x_usart.c...
.\CMSIS\stm32f10x.h(96): error: #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
.\CMSIS\stm32f10x.h: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
.\CMSIS\stm32f10x.h: ^
.\CMSIS\stm32f10x.h: FWlib\src\stm32f10x_usart.c: 0 warnings, 1 error
compiling stm32f10x_wwdg.c...
.\CMSIS\stm32f10x.h(96): error: #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
.\CMSIS\stm32f10x.h: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
.\CMSIS\stm32f10x.h: ^
.\CMSIS\stm32f10x.h: FWlib\src\stm32f10x_wwdg.c: 0 warnings, 1 error
compiling SetClock.c...
.\CMSIS\stm32f10x.h(96): error: #35: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
.\CMSIS\stm32f10x.h: #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
.\CMSIS\stm32f10x.h: ^
在这里添加 USE_STDPERIPH_DRIVER, STM32F10X_HD 问题解决
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error: #101: "DISABLE" has already been declared in the current scope
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: ^
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error: #101: "ENABLE" has already been declared in the current scope
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: ^
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error: #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of ".\CMSIS\stm32f10x.h")
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error: #256: invalid redeclaration of type name "s32" (declared at line 487 of ".\CMSIS\stm32f10x.h")
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef signed long s32;
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: ^
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error: #256: invalid redeclaration of type name "sc32" (declared at line 491 of ".\CMSIS\stm32f10x.h")
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef signed long const sc32; /* Read Only */
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: ^
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error: #256: invalid redeclaration of type name "vs32" (declared at line 495 of ".\CMSIS\stm32f10x.h")
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef volatile signed long vs32;
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: ^
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error: #256: invalid redeclaration of type name "vsc32" (declared at line 499 of ".\CMSIS\stm32f10x.h")
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef volatile signed long const vsc32; /* Read Only */
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error: #256: invalid redeclaration of type name "u32" (declared at line 503 of ".\CMSIS\stm32f10x.h")
C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h: typedef unsigned long u32;
#include "stm32f10x.h" //#include "stm32f10x_lib.h"
往stm32f10x.h文件中添加stm32f10x_conf.h,并且用 #include "stm32f10x.h"代替#include "stm32f10x_lib.h",问题解决。
.\FWlib\inc\stm32f10x_adc.h(52): error: #20: identifier "uint32_t" is undefined
.\FWlib\inc\stm32f10x_adc.h: uint32_t ADC_Mode; /*!< Configures the ADC to operate in independent or
.\FWlib\inc\stm32f10x_adc.h: ^
.\FWlib\inc\stm32f10x_adc.h(56): error: #20: identifier "FunctionalState" is undefined
.\FWlib\inc\stm32f10x_adc.h: FunctionalState ADC_ScanConvMode; /*!< Specifies whether the conversion is performed in
.\FWlib\inc\stm32f10x_adc.h: ^
.\FWlib\inc\stm32f10x_adc.h(60): error: #20: identifier "FunctionalState" is undefined
.\FWlib\inc\stm32f10x_adc.h: FunctionalState ADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in
.\FWlib\inc\stm32f10x_adc.h: ^
.\FWlib\inc\stm32f10x_adc.h(64): error: #20: identifier "uint32_t" is undefined
.\FWlib\inc\stm32f10x_adc.h: uint32_t ADC_ExternalTrigConv; /*!< Defines the external trigger used to start the analog
.\FWlib\inc\stm32f10x_adc.h: ^
.\FWlib\inc\stm32f10x_adc.h(68): error: #20: identifier "uint32_t" is undefined
往stm32f10x_conf.h文件中添加#include
这类错误是 因为stm32函数库版本 不同引起的,用 #include "stm32f10x.h"相互替换#include "stm32f10x_lib.h",问题解决。