[技术问答] Keil __WEAK报错,如何解决

[复制链接]
1525|2
 楼主| CLW_WEI 发表于 2021-1-19 10:02 | 显示全部楼层 |阅读模式
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)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

4

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部