用keil ARM编译提示 warning: #1-D: last line of file ends without a newline

本文介绍了如何解决Python编程中常见的缩进错误问题。当遇到错误提示时,可以在错误行之后添加新的一行并确保没有额外的空格。另一种方法是在倒数第二行的末尾删除导致错误的缩进,并按Enter键。

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

出现此错误时,在错误行(即文件的最后一行)回车后还要保证是在第一列,新一行不能有空格等空字符才能不出此警告。

也可以在上面有文字的倒数第二行的末尾,用del键来删除产生缩进,同时再回车一下就好了。

Rebuild started: Project: 工程模板 *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'E:\keil5\MDK5.36\ARM\ARMCC\Bin' Rebuild target 'Target 1' assembling startup_stm32f10x_hd.s... compiling main.c... .\APP\dsgshow.h(16): warning: #1-D: last line of file ends without a newline #endif .\APP\delay.h(14): warning: #1-D: last line of file ends without a newline #endif /* __DELAY_H */ .\APP\EXTI.C(39): warning: #1-D: last line of file ends without a newline } .\APP\key.h(25): warning: #1-D: last line of file ends without a newline #endif User\main.c(27): warning: #1-D: last line of file ends without a newline } User\main.c: 5 warnings, 0 errors compiling stm32f10x_it.c... compiling misc.c... compiling beepkey.c... APP\delay.h(14): warning: #1-D: last line of file ends without a newline #endif /* __DELAY_H */ APP\beepkey.c(116): warning: #1-D: last line of file ends without a newline } APP\beepkey.c(77): warning: #177-D: variable "i" was declared but never referenced uint32_t i; // ??: ????????? APP\beepkey.c: 3 warnings, 0 errors compiling led.c... APP\led.c(32): warning: #1-D: last line of file ends without a newline } APP\led.c: 1 warning, 0 errors compiling stm32f10x_gpio.c... compiling system_stm32f10x.c... compiling stm32f10x_exti.c... compiling stm32f10x_rcc.c... compiling core_cm3.c... compiling systick.c... compiling delay.c... APP\delay.h(14): warning: #1-D: last line of file ends without a newline #endif /* __DELAY_H */ APP\delay.c(33): warning: #1-D: last line of file ends without a newline } APP\delay.c: 2 warnings, 0 errors compiling EXTI.C... APP\dsgshow.h(16): warning: #1-D: last line of file ends without a newline #endif APP\delay.h(14): warning: #1-D: last line of file ends without a newline #endif /* __DELAY_H */ APP\EXTI.C(39): warning: #1-D: last line of file ends without a newline } APP\EXTI.C: 3 warnings, 0 errors compiling key.c... APP\key.h(25): warning: #1-D: last line of file ends without a newline #endif APP\key.c(47): warning: #1-D: last line of file ends without a newline } APP\key.c: 2 warnings, 0 errors compiling dsgshow.c... APP\dsgshow.h(16): warning: #1-D: last line of file ends without a newline #endif APP\delay.h(14): warning: #1-D: last line of file ends without a newline #endif /* __DELAY_H */ APP\dsgshow.c: 2 warnings, 0 errors linking... .\Output\工程模板.axf: Error: L6200E: Symbol hour multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol minute multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol second multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol smgduan multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol smgwei multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol DsgShowInit multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol DsgShowNum multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol DsgShowTime multiply defined (by dsgshow.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI0_IRQHandler multiply defined (by stm32f10x_it.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI0_IRQHandler multiply defined (by exti.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI1_IRQHandler multiply defined (by stm32f10x_it.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI1_IRQHandler multiply defined (by exti.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI2_IRQHandler multiply defined (by stm32f10x_it.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI2_IRQHandler multiply defined (by exti.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol EXTI15_10_IRQHandler multiply defined (by exti.o and main.o). .\Output\工程模板.axf: Error: L6200E: Symbol delay_ms multiply defined (by delay.o and systick.o). .\Output\工程模板.axf: Error: L6200E: Symbol delay_us multiply defined (by delay.o and systick.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 17 error messages. ".\Output\工程模板.axf" - 17 Error(s), 18 Warning(s). Target not created. Build Time Elapsed: 00:00:01
06-17
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'takeatry' assembling startup_stm32f103xe.s... compiling main.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/main.c(4): error: #20: identifier "TASK_IDLE" is undefined TaskMode current_task = TASK_IDLE; ../Core/Src/main.c(27): warning: #223-D: function "Key_Scan" declared implicitly if (Key_Scan(KEY1_PIN, KEY1_PORT) && !task_running) { ../Core/Src/main.c(27): error: #20: identifier "KEY1_PIN" is undefined if (Key_Scan(KEY1_PIN, KEY1_PORT) && !task_running) { ../Core/Src/main.c(27): error: #20: identifier "KEY1_PORT" is undefined if (Key_Scan(KEY1_PIN, KEY1_PORT) && !task_running) { ../Core/Src/main.c(32): warning: #223-D: function "Key_Scan" declared implicitly if (Key_Scan(KEY2_PIN, KEY2_PORT) && !task_running) { ../Core/Src/main.c(32): error: #20: identifier "KEY2_PIN" is undefined if (Key_Scan(KEY2_PIN, KEY2_PORT) && !task_running) { ../Core/Src/main.c(32): error: #20: identifier "KEY2_PORT" is undefined if (Key_Scan(KEY2_PIN, KEY2_PORT) && !task_running) { ../Core/Src/main.c(37): warning: #223-D: function "Key_Scan" declared implicitly if (Key_Scan(KEY3_PIN, KEY3_PORT) && !task_running) { ../Core/Src/main.c(37): error: #20: identifier "KEY3_PIN" is undefined if (Key_Scan(KEY3_PIN, KEY3_PORT) && !task_running) { ../Core/Src/main.c(37): error: #20: identifier "KEY3_PORT" is undefined if (Key_Scan(KEY3_PIN, KEY3_PORT) && !task_running) { ../Core/Src/main.c(147): error: #159: declaration is incompatible with previous "Key_Scan" (declared at line 27) uint8_t Key_Scan(uint16_t pin, GPIO_TypeDef *port) { ../Core/Src/main.c(168): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/main.c: 5 warnings, 8 errors compiling stm32f1xx_hal_rcc_ex.c... compiling stm32f1xx_it.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/stm32f1xx_it.c: 1 warning, 0 errors compiling buzzer.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ buzzer.c(26): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ buzzer.c: 2 warnings, 0 errors compiling stm32f1xx_hal_gpio_ex.c... compiling stm32f1xx_hal.c... compiling motor.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ motor.c(51): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ motor.c: 2 warnings, 0 errors compiling gpio.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/gpio.c: 1 warning, 0 errors compiling stm32f1xx_hal_rcc.c... compiling stm32f1xx_hal_tim_ex.c... compiling sensor.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ sensor.c(65): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ sensor.c: 2 warnings, 0 errors compiling stm32f1xx_hal_gpio.c... compiling stm32f1xx_hal_tim.c... compiling tim.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/tim.c: 1 warning, 0 errors compiling stm32f1xx_hal_msp.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/stm32f1xx_hal_msp.c: 1 warning, 0 errors compiling stm32f1xx_hal_dma.c... compiling stm32f1xx_hal_cortex.c... compiling stm32f1xx_hal_pwr.c... compiling stm32f1xx_hal_flash.c... compiling stm32f1xx_hal_flash_ex.c... compiling system_stm32f1xx.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/system_stm32f1xx.c(67): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/system_stm32f1xx.c: 2 warnings, 0 errors compiling stm32f1xx_hal_exti.c... "takeatry\takeatry.axf" - 8 Error(s), 17 Warning(s). Target not created. Build Time Elapsed: 00:02:10
07-13
*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target 'Target 1' compiling i2c.c... i2c.h(6): error: #147-D: declaration is incompatible with "void I2C_Init(I2C_TypeDef *, I2C_InitTypeDef *)" (declared at line 535 of ".\Library\stm32f10x_i2c.h") void I2C_Init(void); i2c.h(15): warning: #1-D: last line of file ends without a newline #endif i2c.c(20): warning: #223-D: function "SDA_OUT" declared implicitly SDA_OUT(); i2c.c(21): warning: #223-D: function "I2C_SDA_H" declared implicitly I2C_SDA_H(); i2c.c(22): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); i2c.c(24): warning: #223-D: function "I2C_SDA_L" declared implicitly I2C_SDA_L(); i2c.c(26): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(31): warning: #223-D: function "SDA_OUT" declared implicitly SDA_OUT(); i2c.c(32): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(33): warning: #223-D: function "I2C_SDA_L" declared implicitly I2C_SDA_L(); i2c.c(35): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); i2c.c(36): warning: #223-D: function "I2C_SDA_H" declared implicitly I2C_SDA_H(); i2c.c(43): warning: #223-D: function "SDA_OUT" declared implicitly SDA_OUT(); i2c.c(44): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(46): warning: #223-D: function "I2C_SDA_H" declared implicitly if((txd & 0x80) >> 7) I2C_SDA_H(); i2c.c(47): warning: #223-D: function "I2C_SDA_L" declared implicitly else I2C_SDA_L(); i2c.c(50): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); i2c.c(60): warning: #223-D: function "SDA_IN" declared implicitly SDA_IN(); i2c.c(62): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(64): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); i2c.c(66): error: #20: identifier "READ_SDA" is undefined if(READ_SDA) receive++; i2c.c(77): warning: #223-D: function "SDA_IN" declared implicitly SDA_IN(); i2c.c(78): warning: #223-D: function "I2C_SDA_H" declared implicitly I2C_SDA_H(); Delay_us(1); i2c.c(79): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); Delay_us(5); i2c.c(80): error: #20: identifier "READ_SDA" is undefined while(READ_SDA) { i2c.c(87): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(93): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(94): warning: #223-D: function "SDA_OUT" declared implicitly SDA_OUT(); i2c.c(95): warning: #223-D: function "I2C_SDA_L" declared implicitly I2C_SDA_L(); i2c.c(97): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); i2c.c(104): warning: #223-D: function "I2C_SCL_L" declared implicitly I2C_SCL_L(); i2c.c(105): warning: #223-D: function "SDA_OUT" declared implicitly SDA_OUT(); i2c.c(106): warning: #223-D: function "I2C_SDA_H" declared implicitly I2C_SDA_H(); i2c.c(108): warning: #223-D: function "I2C_SCL_H" declared implicitly I2C_SCL_H(); i2c.c(120): warning: #1-D: last line of file ends without a newline #define READ_SDA (GPIOB->IDR & GPIO_Pin_7) i2c.c: 32 warnings, 3 errors compiling main.c... User\main.c(6): error: #5: cannot open source input file "mpu6050.h": No such file or directory #include "mpu6050.h" // 鏇挎崲jy61p.h涓篗PU6050椹卞姩 User\main.c: 0 warnings, 1 error compiling mpu6050.c... mpu6050.h(21): warning: #1-D: last line of file ends without a newline #endif i2c.h(6): error: #147-D: declaration is incompatible with "void I2C_Init(I2C_TypeDef *, I2C_InitTypeDef *)" (declared at line 535 of ".\Library\stm32f10x_i2c.h") void I2C_Init(void); i2c.h(15): warning: #1-D: last line of file ends without a newline #endif mpu6050.c(69): warning: #1-D: last line of file ends without a newline } mpu6050.c: 3 warnings, 1 error ".\Objects\Project.axf" - 5 Error(s), 35 Warning(s). Target not created. Build Time Elapsed: 00:00:01
最新发布
07-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值