CLW_WEI 发表于 2021-1-19 10:02

Keil __WEAK报错,如何解决

keil V 5.21.1.0 不认_WEAK, 导致interrupts_HC32F072,无法编译通过。请问有谁遇到过?

..\..\..\mcu\common\interrupts_hc32f072.c(62): error:#77-D: this declaration has no storage class or type specifier
__WEAK void SysTick_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(62): error:#65: expected a ";"
__WEAK void SysTick_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(65): error:#77-D: this declaration has no storage class or type specifier
__WEAK void PortA_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(65): error:#65: expected a ";"
__WEAK void PortA_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(66): error:#77-D: this declaration has no storage class or type specifier
__WEAK void PortB_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(66): error:#65: expected a ";"
__WEAK void PortB_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(67): error:#77-D: this declaration has no storage class or type specifier
__WEAK void PortC_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(67): error:#65: expected a ";"
__WEAK void PortC_IRQHandler(void);
..\..\..\mcu\common\interrupts_hc32f072.c(68): error:#77-D: this declaration has no storage class or type specifier

martinhu 发表于 2021-1-19 13:14

你这个应该是KEIL的老版本,使用新版本的KEIL,或者__WEAK改成小写

麻花油条 发表于 2021-1-19 15:20

例如__weak void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef *htim)
页: [1]
查看完整版本: Keil __WEAK报错,如何解决