KEIL Note: source file ‘.XXX.o‘ - object file renamed from ‘XXX.o‘ to ...

本文介绍了解决在Keil工程中因误操作导致的相同.c文件出现在不同组而导致的编译错误的方法。首先需要删除重复的文件,然后通过运行keilkill.bat清理编译产生的临时文件,最后重新编译工程。

问题描述

1、在keil工程中将App组份内,c文件移动到Dev组分,
2、在使用keil的时候,有时候会不小心在不同的group文件夹里添加了两个相同的.c文件
这时编译会出现:
Note: source file ‘…\Core\Src\gpio.c’ - object file renamed from ‘7.710.200C\gpio.o’ to ‘7.710.200C\gpio_1.o’.
报错

解决方案

1、删除重复文件,确保.c文件在工程内不重复
2、关闭KEIL工程,并运行keilkill.bat将编译链接文件全部删除
3、打开工程进行编译即可

附 keilkill.bat 代码

del *.bak /s
del *.ddk /s
del *.edk /s
del *.lst /s
del *.lnp /s
del *.mpf /s
del *.mpj /s
del *.obj /s
del *.omf /s
::del *.opt /s  ::不允许删除JLINK的设置
del *.plg /s
del *.rpt /s
del *.tmp /s
del *.__i /s
del *.crf /s
del *.o /s
del *.d /s
del *.axf /s
del *.tra /s
del *.dep /s           
del JLinkLog.txt /s

del *.iex /s
del *.htm /s
del *.sct /s
del *.map /s
exit

将内容复制到txt文件中,保存退出后将.txt后缀更改为.bat即可。将修改好的bat文件放到工程内运行就ok啦

Rebuild started: Project: display *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\MCUSTM32\ARM\ARMCC\Bin' Rebuild target 'display' Note: source file '..\CORE\system_stm32f10x.c' - object file renamed from '.\Objects\system_stm32f10x.o' to '.\Objects\system_stm32f10x_1.o'. assembling startup_stm32f10x_md.s... compiling misc.c... compiling main.c... ..\USER\main.h(6): error: #5: cannot open source input file "system.h": No such file or directory #include "system.h" // 实现GPIO的位段操作 ..\USER\main.c: 0 warnings, 1 error compiling delay.c... compiling system_stm32f10x.c... compiling stm32f10x_rcc.c... compiling core_cm3.c... compiling stm32f10x_gpio.c... compiling stm32f10x_it.c... compiling stm32f10x_rtc.c... compiling led.c... ..\APP\led.h(4): error: #5: cannot open source input file "system.h": No such file or directory #include "system.h" ..\APP\led.c: 0 warnings, 1 error compiling stm32f10x_tim.c... compiling stm32f10x_exti.c... compiling rtc.c... ..\APP\rtc.h(5): error: #5: cannot open source input file "system.h": No such file or directory #include "system.h" ..\APP\rtc.c: 0 warnings, 1 error compiling display.c... compiling stm32f10x_usart.c... compiling timer.c... ..\APP\led.h(4): error: #5: cannot open source input file "system.h": No such file or directory #include "system.h" ..\APP\timer.c: 0 warnings, 1 error compiling usart.c... ..\USER\main.h(6): error: #5: cannot open source input file "system.h": No such file or directory #include "system.h" // 实现GPIO的位段操作 ..\APP\usart.c: 0 warnings, 1 error ".\Objects\display.axf" - 5 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:02
06-13
Build started: Project: bbss *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\k5\ARM\ARMCC\Bin' Build target 'bbss' Note: source file '../Core/Src/system_stm32f4xx.c' - object file renamed from 'bbss\system_stm32f4xx.o' to 'bbss\system_stm32f4xx_1.o'. compiling adc.c... compiling tim.c... compiling stm32f4xx_hal_msp.c... compiling i2c.c... compiling dac.c... compiling gpio.c... compiling system_stm32f4xx.c... compiling main.c... ..\Core\Src\main.c(24): warning: #223-D: function "SystemClock_Config" declared implicitly SystemClock_Config(); ..\Core\Src\main.c(33): warning: #223-D: function "OLED_Init" declared implicitly OLED_Init(); ..\Core\Src\main.c(34): warning: #223-D: function "OLED_Clear" declared implicitly OLED_Clear(); ..\Core\Src\main.c(80): warning: #223-D: function "OLED_ShowString" declared implicitly OLED_ShowString(0, 0, "Timeout "); ..\Core\Src\main.c(82): warning: #223-D: function "OLED_ShowString" declared implicitly OLED_ShowString(0, 0, "Hi "); ..\Core\Src\main.c(84): warning: #223-D: function "sprintf" declared implicitly sprintf(buffer, "%.1f kΩ", resistance); ..\Core\Src\main.c(85): warning: #223-D: function "OLED_ShowString" declared implicitly OLED_ShowString(0, 0, buffer); ..\Core\Src\main.c(106): warning: #223-D: function "fabs" declared implicitly if (fabs(current_resistance - prev_resistance) < 0.1f) { ..\Core\Src\main.c(122): warning: #223-D: function "OLED_ShowString" declared implicitly OLED_ShowString(0, 0, "Timeout "); ..\Core\Src\main.c(124): warning: #1-D: last line of file ends without a newline } ..\Core\Src\main.c(18): warning: #550-D: variable "stability_counter" was set but never used static uint32_t stability_counter = 0; ..\Core\Src\main.c: 11 warnings, 0 errors
03-23
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值