打印
[技术问答]

Keil __WEAK报错,如何解决

[复制链接]
1131|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

粉丝