Keil常见错误――last line of file ends without a newline原因及解决方法

本文详细介绍了在使用Keil软件编译过程中遇到的常见警告:#1-D: lastlineoffileendswithoutanewline的解决方法。即便遵循了常规的删除多余空行并回车的操作,有时仍会遇到此警告。文章提供了额外的解决方案,即在回车后再次按删除键,确保光标位于行首,以彻底消除这一编译警告。

转自:https://blog.youkuaiyun.com/new_eggs/article/details/8613073 侵删

Keil软件编译的时候,总会出现一个问题:
warning:  #1-D: lastline of file ends without a newline!如下图所示:

百度下结局办法就是

将光标移到提示告警的代码最后一行(有代码的那一行)然后按住del键,直到确定下面没有回车行,最后回车一下或多下即可。
但是,我的编译器还是会报同样的错误,不知道是我的KEIL原因还是电脑设置的原因。
解决的的办法就是,在上边的的方法后再按一个删除键。一定要确保上面方法回车一下时候,光标在最开始的位置,而不是空一格。
 

*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'Target 1' compiling dht11.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\delay\delay.h(16): warning: #1-D: last line of file ends without a newline #endif HARDWARE\DHT11\dht11.h(9): warning: #1-D: last line of file ends without a newline #endif HARDWARE\DHT11\dht11.c(55): warning: #1-D: last line of file ends without a newline } HARDWARE\DHT11\dht11.c: 5 warnings, 0 errors compiling stm32f10x_it.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif USER\stm32f10x_it.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif USER\stm32f10x_it.c(46): warning: #1-D: last line of file ends without a newline } USER\stm32f10x_it.c: 4 warnings, 0 errors compiling oled.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\delay\delay.h(16): warning: #1-D: last line of file ends without a newline #endif HARDWARE\OLED\oled.h(18): warning: #1-D: last line of file ends without a newline #endif HARDWARE\OLED\oled.c(163): warning: #1-D: last line of file ends without a newline } HARDWARE\OLED\oled.c: 5 warnings, 0 errors compiling misc.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif FWLIB\src\misc.c: 1 warning, 0 errors compiling sys.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif SYSTEM\sys\sys.c(43): warning: #1-D: last line of file ends without a newline } SYSTEM\sys\sys.c: 3 warnings, 0 errors compiling hc_sr501.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif HARDWARE\HC_SR501\hc_sr501.h(8): warning: #1-D: last line of file ends without a newline #endif HARDWARE\HC_SR501\hc_sr501.c(14): warning: #1-D: last line of file ends without a newline } HARDWARE\HC_SR501\hc_sr501.c: 4 warnings, 0 errors compiling main.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\delay\delay.h(16): warning: #1-D: last line of file ends without a newline #endif .\HARDWARE\DHT11\dht11.h(9): warning: #1-D: last line of file ends without a newline #endif .\HARDWARE\OLED\oled.h(18): warning: #1-D: last line of file ends without a newline #endif .\HARDWARE\Key\key.h(14): warning: #1-D: last line of file ends without a newline #endif .\HARDWARE\LED\led.h(10): warning: #1-D: last line of file ends without a newline #endif .\HARDWARE\Relay\relay.h(9): warning: #1-D: last line of file ends without a newline #endif .\HARDWARE\HC_SR501\hc_sr501.h(8): warning: #1-D: last line of file ends without a newline #endif USER\stm32f10x_it.h(14): warning: #1-D: last line of file ends without a newline #endif USER\main.c(67): warning: #1-D: last line of file ends without a newline } USER\main.c: 11 warnings, 0 errors compiling relay.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif HARDWARE\Relay\relay.h(9): warning: #1-D: last line of file ends without a newline #endif HARDWARE\Relay\relay.c(21): warning: #1-D: last line of file ends without a newline } HARDWARE\Relay\relay.c: 4 warnings, 0 errors compiling delay.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif SYSTEM\delay\delay.h(16): warning: #1-D: last line of file ends without a newline #endif SYSTEM\delay\delay.c(32): warning: #1-D: last line of file ends without a newline } SYSTEM\delay\delay.c: 3 warnings, 0 errors compiling led.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif HARDWARE\LED\led.h(10): warning: #1-D: last line of file ends without a newline #endif HARDWARE\LED\led.c(24): warning: #188-D: enumerated type mixed with another type GPIO_WriteBit(LED_PORT, LED_PIN, !GPIO_ReadOutputDataBit(LED_PORT, LED_PIN)); HARDWARE\LED\led.c(25): warning: #1-D: last line of file ends without a newline } HARDWARE\LED\led.c: 5 warnings, 0 errors compiling key.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\sys\sys.h(33): warning: #1-D: last line of file ends without a newline #endif .\SYSTEM\delay\delay.h(16): warning: #1-D: last line of file ends without a newline #endif HARDWARE\Key\key.h(14): warning: #1-D: last line of file ends without a newline #endif HARDWARE\Key\key.c(29): warning: #1-D: last line of file ends without a newline } HARDWARE\Key\key.c: 5 warnings, 0 errors compiling core_cm3.c... compiling stm32f10x_gpio.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif FWLIB\src\stm32f10x_gpio.c: 1 warning, 0 errors compiling stm32f10x_i2c.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif FWLIB\src\stm32f10x_i2c.c: 1 warning, 0 errors compiling stm32f10x_rcc.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif FWLIB\src\stm32f10x_rcc.c: 1 warning, 0 errors compiling stm32f10x_tim.c... .\USER\stm32f10x_conf.h(14): warning: #1-D: last line of file ends without a newline #endif FWLIB\src\stm32f10x_tim.c: 1 warning, 0 errors linking... .\Objects\ff.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST. Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 1 error messages. ".\Objects\ff.axf" - 1 Error(s), 54 Warning(s). Target not created. Build Time Elapsed: 00:00:01 帮我解决keil上的错误
最新发布
12-16
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值