报错的是头文件,但是头文件用的应该是一样的,是不是我哪个地方没设置好?报错如下
Build target 'Template'
compiling main.c...
compiling stm32f4xx_it.c...
compiling system_stm32f4xx.c...
compiling misc.c...
compiling stm32f4xx_gpio.c...
compiling stm32f4xx_rcc.c...
compiling stm32f4xx_usart.c...
compiling delay.c...
compiling sys.c...
compiling usart.c...
compiling led.c...
..USERstm32f4xx.h(172): error: #130: expected a "{"
typedef enum IRQn
..USERstm32f4xx.h(175): error: #20: identifier "NonMaskableInt_IRQn" is undefined
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
..USERstm32f4xx.h(176): error: #20: identifier "MemoryManagement_IRQn" is undefined
MemoryManagement_IRQn = -12, /*!< 4 Cortex-M4 Memory Management Interrupt */
..USERstm32f4xx.h(177): error: #20: identifier "BusFault_IRQn" is undefined
BusFault_IRQn = -11, /*!< 5 Cortex-M4 Bus Fault Interrupt */
..USERstm32f4xx.h(178): error: #20: identifier "UsageFault_IRQn" is undefined
UsageFault_IRQn = -10, /*!< 6 Cortex-M4 Usage Fault Interrupt */
..USERstm32f4xx.h(179): error: #20: identifier "SVCall_IRQn" is undefined
SVCall_IRQn = -5, /*!< 11 Cortex-M4 SV Call Interrupt */
..USERstm32f4xx.h(180): error: #20: identifier "DebugMonitor_IRQn" is undefined
DebugMonitor_IRQn = -4, /*!< 12 Cortex-M4 Debug Monitor Interrupt */
..USERstm32f4xx.h(181): error: #20: identifier "PendSV_IRQn" is undefined
PendSV_IRQn = -2, /*!< 14 Cortex-M4 Pend SV Interrupt */
..USERstm32f4xx.h(182): error: #20: identifier "SysTick_IRQn" is undefined
SysTick_IRQn = -1, /*!< 15 Cortex-M4 System Tick Interrupt */
..USERstm32f4xx.h(184): error: #20: identifier "WWDG_IRQn" is undefined
WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
..USERstm32f4xx.h(185): error: #20: identifier "PVD_IRQn" is undefined
PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
..USERstm32f4xx.h(186): error: #20: identifier "TAMP_STAMP_IRQn" is undefined
TAMP_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line */
..USERstm32f4xx.h(187): error: #20: identifier "RTC_WKUP_IRQn" is undefined
RTC_WKUP_IRQn = 3, /*!< RTC Wakeup interrupt through the EXTI line */
..USERstm32f4xx.h(188): error: #20: identifier "FLASH_IRQn" is undefined
FLASH_IRQn = 4, /*!< FLASH global Interrupt */
..USERstm32f4xx.h(189): error: #20: identifier "RCC_IRQn" is undefined
RCC_IRQn = 5, /*!< RCC global Interrupt */
..USERstm32f4xx.h(190): error: #20: identifier "EXTI0_IRQn" is undefined
EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
..USERstm32f4xx.h(191): error: #20: identifier "EXTI1_IRQn" is undefined
EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
..USERstm32f4xx.h(192): error: #20: identifier "EXTI2_IRQn" is undefined
EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
..USERstm32f4xx.h(193): error: #20: identifier "EXTI3_IRQn" is undefined
EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
..USERstm32f4xx.h(194): error: #20: identifier "EXTI4_IRQn" is undefined
EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
..USERstm32f4xx.h(195): error: #20: identifier "DMA1_Stream0_IRQn" is undefined
DMA1_Stream0_IRQn = 11, /*!< DMA1 Stream 0 global Interrupt */
..USERstm32f4xx.h(196): error: #20: identifier "DMA1_Stream1_IRQn" is undefined
DMA1_Stream1_IRQn = 12, /*!< DMA1 Stream 1 global Interrupt */
..USERstm32f4xx.h(197): error: #20: identifier "DMA1_Stream2_IRQn" is undefined
DMA1_Stream2_IRQn = 13, /*!< DMA1 Stream 2 global Interrupt */
..USERstm32f4xx.h(198): error: #20: identifier "DMA1_Stream3_IRQn" is undefined
DMA1_Stream3_IRQn = 14, /*!< DMA1 Stream 3 global Interrupt */
..USERstm32f4xx.h(199): error: #20: identifier "DMA1_Stream4_IRQn" is undefined
DMA1_Stream4_IRQn = 15, /*!< DMA1 Stream 4 global Interrupt */
..USERstm32f4xx.h(200): error: #20: identifier "DMA1_Stream5_IRQn" is undefined
DMA1_Stream5_IRQn = 16, /*!< DMA1 Stream 5 global Interrupt */
..USERstm32f4xx.h(201): error: #20: identifier "DMA1_Stream6_IRQn" is undefined
DMA1_Stream6_IRQn = 17, /*!< DMA1 Stream 6 global Interrupt */
..USERstm32f4xx.h(202): error: #20: identifier "ADC_IRQn" is undefined
ADC_IRQn = 18, /*!< ADC1, ADC2 and ADC3 global Interrupts */
..USERstm32f4xx.h(205): error: #20: identifier "CAN1_TX_IRQn" is undefined
CAN1_TX_IRQn = 19, /*!< CAN1 TX Interrupt */
..USERstm32f4xx.h(206): error: #20: identifier "CAN1_RX0_IRQn" is undefined
CAN1_RX0_IRQn = 20, /*!< CAN1 RX0 Interrupt */
..HERDWARELEDled.c: 0 warnings, 30 errors
"..OBJTemplate.axf" - 30 Error(s), 0 Warning(s).
Target not created.
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
---------------------------------
是没有问题的,应该是我操作的问题,可是不知道为什么,因为报错是在直接从模板中复制过来的stm32f4xx.h,所以很头疼。。。
一周热门 更多>