最近升级了MDK到5.23,为了支持C++11编译器选择为C++11,可是大量的错误出现了,折腾了好几天,求大神解答啊!!!!!!跪谢了
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_crc.c(29): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_crc.h(38): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling stm32f4xx_crc.c...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c(84): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_gpio.h(38): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling stm32f4xx_gpio.c...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c(59): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_rcc.h(37): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling stm32f4xx_rcc.c...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c(50): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_syscfg.h(38): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling stm32f4xx_syscfg.c...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c(76): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incmisc.h(38): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling misc.c...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c(119): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_tim.h(38): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling stm32f4xx_tim.c...
../User/system_stm32f4xx.c(215): warning: In file included from...
../STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx.h(149): error: 'stm32f407xx.h' file not found
#include "stm32f407xx.h"
^
1 error generated.
compiling system_stm32f4xx.c...
".Objproject.axf" - 13 Error(s), 0 Warning(s).
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
其实就一个错,没找到stm32f407xx.h,还有别的错误嘛?
6 errors generated.
compiling stm32f4xx_can.c...
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c(72): warning: In file included from...
../Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_flash.h(38): warning: In file included from...
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(462): warning: In file included from...
../Libraries/CMSIS/Includecore_cm4.h(1435): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1435): error: expected identifier or '('
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
;
../Libraries/CMSIS/Includecore_cm4.h(1717): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
../Libraries/CMSIS/Includecore_cm4.h(1717): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
;
6 errors generated.
compiling stm32f4xx_flash.c...
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_iwdg.c(85): warning: In file included from...
../Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_iwdg.h(38): warning: In file included from...
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(462): warning: In file included from...
../Libraries/CMSIS/Includecore_cm4.h(1435): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1435): error: expected identifier or '('
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
;
../Libraries/CMSIS/Includecore_cm4.h(1717): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
../Libraries/CMSIS/Includecore_cm4.h(1717): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
;
6 errors generated.
compiling stm32f4xx_iwdg.c...
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c(119): warning: In file included from...
../Libraries/STM32F4xx_StdPeriph_Driver/incstm32f4xx_tim.h(38): warning: In file included from...
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(462): warning: In file included from...
../Libraries/CMSIS/Includecore_cm4.h(1435): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1435): error: expected identifier or '('
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
;
../Libraries/CMSIS/Includecore_cm4.h(1717): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c(1027): warning: implicit conversion loses integer precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion]
tmp1 = CCER_CCE_SET << (uint16_t)TIM_Channel;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c(1795): warning: implicit conversion loses integer precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion]
tmp = CCER_CCE_SET << TIM_Channel;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c(1825): warning: implicit conversion loses integer precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion]
tmp = CCER_CCNE_SET << TIM_Channel;
~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
../Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c(2236): warning: implicit conversion loses integer precision: 'unsigned int' to 'uint16_t' (aka 'unsigned short') [-Wconversion]
TIM_BDTRInitStruct->TIM_Break | TIM_BDTRInitStruct->TIM_BreakPolarity |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
4 warnings and 6 errors generated.
compiling stm32f4xx_tim.c...
../User/SYSTEM/stm32f4xx_assert.c(1): warning: non-portable path to file '"MAIN.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "main.h"
^~~~~~~~
"MAIN.h"
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
../Libraries/CMSIS/Includecore_cm4.h(1455): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
^
;
../Libraries/CMSIS/Includecore_cm4.h(1717): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
../Libraries/CMSIS/Includecore_cm4.h(1717): error: expected ';' after top level declarator
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
^
;
../User/SYSTEM/stm32f4xx_assert.c(1): warning: In file included from...
../Usermain.h(13): warning: non-portable path to file '"NVIC.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "NVIC.H"
^~~~~~~~
"NVIC.h"
../Usermain.h(14): warning: non-portable path to file '"CAN.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "CAN.H"
^~~~~~~
"CAN.h"
../Usermain.h(15): warning: non-portable path to file '"LED.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "LED.H"
^~~~~~~
"LED.h"
../User/SYSTEM/stm32f4xx_assert.c(1): warning: In file included from...
../Usermain.h(15): warning: In file included from...
../User/LED.H(4): warning: In file included from...
../User/AgreedTerms.h(15): warning: redefinition of typedef 'u8' is a C11 feature [-Wtypedef-redefinition]
typedef unsigned char u8;
^
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(488): note: previous definition is here
typedef uint8_t u8;
^
../User/SYSTEM/stm32f4xx_assert.c(1): warning: In file included from...
../Usermain.h(15): warning: In file included from...
../User/LED.H(4): warning: In file included from...
../User/AgreedTerms.h(25): warning: redefinition of typedef 'u16' is a C11 feature [-Wtypedef-redefinition]
typedef unsigned short int u16;
^
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(487): note: previous definition is here
typedef uint16_t u16;
^
../User/SYSTEM/stm32f4xx_assert.c(1): warning: In file included from...
../Usermain.h(15): warning: In file included from...
../User/LED.H(4): warning: In file included from...
../User/AgreedTerms.h(32): warning: redefinition of typedef 'u32' is a C11 feature [-Wtypedef-redefinition]
typedef unsigned int u32;
^
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(486): note: previous definition is here
typedef uint32_t u32;
^
7 warnings and 6 errors generated.
compiling stm32f4xx_assert.c...
../User/SYSTEM/sys.c(1): warning: In file included from...
../User/SYSTEM/sys.h(3): warning: In file included from...
../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h(462): warning: In file included from...
../Libraries/CMSIS/Includecore_cm4.h(1435): error: unknown type name '__STATIC_INLINE'
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h(1435): error: expected identifier or '('
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
^
../Libraries/CMSIS/Includecore_cm4.h:1455:1: ../User/SYSTEM/sys.c:22:7: error: expected '(' after 'asm'
__asm void WFI_SET(void)
^
../User/SYSTEM/sys.c(22): error: expected ';' after top-level asm block
__asm void WFI_SET(void)
^
;
../User/SYSTEM/sys.c(24): error: use of undeclared identifier 'WFI'
WFI;
^
../User/SYSTEM/sys.c(27): error: expected '(' after 'asm'
__asm void INTX_DISABLE(void)
^
../User/SYSTEM/sys.c(27): error: expected ';' after top-level asm block
__asm void INTX_DISABLE(void)
^
;
../User/SYSTEM/sys.c(29): error: use of undeclared identifier 'CPSID'
CPSID I
^
../User/SYSTEM/sys.c(33): error: expected '(' after 'asm'
__asm void INTX_ENABLE(void)
^
../User/SYSTEM/sys.c(33): error: expected ';' after top-level asm block
__asm void INTX_ENABLE(void)
^
;
../User/SYSTEM/sys.c(35): error: use of undeclared identifier 'CPSIE'
CPSIE I
^
../User/SYSTEM/sys.c(40): error: expected '(' after 'asm'
__asm void MSR_MSP(u32 addr)
^
../User/SYSTEM/sys.c(40): error: expected ';' after top-level asm block
__asm void MSR_MSP(u32 addr)
^
;
../User/SYSTEM/sys.c(42): error: use of undeclared identifier 'MSR'
MSR MSP, r0 //set Main Stack value
^
../User/SYSTEM/sys.c(40): warning: unused parameter 'addr' [-Wunused-parameter]
__asm void MSR_MSP(u32 addr)
^
1 warning and 18 errors generated.
compiling sys.c...
../User/SYSTEM/system_stm32f4xx.c(262): warning: In file included from...
In file included from ../Libraries/CMSIS/Device/ST/STM32F4xx/Includestm32f4xx.h:../User/SYSTEM/system_stm32f4xx.c:371:12: warning: no previous extern declaration for non-static variable 'SystemCoreClock' [-Wmissing-variable-declarations]
uint32_t SystemCoreClock = 168000000;
^
../User/SYSTEM/system_stm32f4xx.c(386): warning: no previous extern declaration for non-static variable 'AHBPrescTable' [-Wmissing-variable-declarations]
__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
^
../User/SYSTEM/system_stm32f4xx.c(420): warning: '__FPU_USED' is not defined, evaluates to 0 [-Wundef]
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
^
../User/SYSTEM/system_stm32f4xx.c(657): warning: while loop has empty body [-Wempty-body]
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);
^
../User/SYSTEM/system_stm32f4xx.c(657): note: put the semicolon on a separate line to silence this warning
4 warnings and 6 errors generated.
一周热门 更多>