Keil MDK-ARM v5.38 编译RT-Thread报错 “.\build\rtthread-stm32.axf“ - 3 Error(s), 0 Warning(s).

在KeilMDK-ARMv5.38中尝试编译RT-Thread工程时遇到错误,原因是从5.37版本开始AC5(ARMCompiler)未默认安装。由于编译器版本6缺少某些宏定义,如SIG_ERR,导致编译失败。解决方法是回退到5.37或更早版本并手动安装AC5,选择编译器版本5后,工程能成功编译通过。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述

Keil MDK-ARM v5.38版本打开RT-Thread 的软件仿真工程文件,之后进行编译时报错 “.\build\rtthread-stm32.axf” - 3 Error(s), 0 Warning(s).
keil报的三个错误为:
在这里插入图片描述

问题分析

报错信息提示为三个使用的宏没有定义。理论上讲从RT-Thread官网上下载的demo用例不应该出现这种问题才对。

问题解决

经过对比5.38版本相较于旧版更新的部分功能,发现自MDK5.37开始,AC5(ARMCC)不再默认安装,此时在Keil中打开Options for Target可以看到Code Generation ARM Compiler如下:
在这里插入图片描述

由于compiler version6编译器中没有SIG_ERR等宏,所以使用compiler version6对RT-Thread软件仿真文件进行编译时会报错。

解决办法

  • 改用Keil MDK-ARM V5.37或更早的版本
  • 手动安装AC5(ARMCC)

结果

改用Keil MDK-ARM V5.35后,在Keil中打开Options for Target可以看到Code Generation ARM Compiler如下:
在这里插入图片描述
选中compiler version5后再对工程文件进行编译。
编译成功!
在这里插入图片描述

安装包

需要Keil MDK-ARM V5.35的文末自取:

  • Keil MDK-ARM V5.35
    链接:https://pan.baidu.com/s/1OXv1n3hTDNNuRMjj9Wvaxw
    提取码:axra
Rebuild started: Project: LED *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' Rebuild target 'LED' assembling startup_stm32f10x_hd.s... startup_stm32f10x_hd.s: Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead. compiling core_cm3.c... Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead. Fatal error: L3900U: Unrecognized option '--vfemode=force'. Finished: 0 information, 0 warning, 0 error and 1 fatal error messages. compiling misc.c... compiling stm32f10x_adc.c... compiling system_stm32f10x.c... compiling stm32f10x_it.c... compiling main.c... compiling stm32f10x_bkp.c... compiling stm32f10x_can.c... compiling stm32f10x_cec.c... compiling stm32f10x_dbgmcu.c... compiling stm32f10x_dma.c... compiling stm32f10x_exti.c... compiling stm32f10x_crc.c... compiling stm32f10x_dac.c... compiling stm32f10x_flash.c... compiling stm32f10x_fsmc.c... compiling stm32f10x_iwdg.c... compiling stm32f10x_i2c.c... compiling stm32f10x_gpio.c... compiling stm32f10x_pwr.c... compiling stm32f10x_rcc.c... compiling stm32f10x_rtc.c... compiling stm32f10x_sdio.c... compiling stm32f10x_spi.c... compiling stm32f10x_wwdg.c... compiling delay.c... compiling stm32f10x_usart.c... compiling bsp.c... compiling stm32f10x_tim.c... compiling bsp_LED.c... "..\OBJ\LED.axf" - 1 Error(s), 2 Warning(s). Target not created. Build Time Elapsed: 00:00:03
03-08
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值