keil编译出现..\OBJ\USART.axf: error: L6002U: Could not open file ..\obj\sys.o: No such file or directory

keil5在编译时出现…\OBJ\USART.axf: error: L6002U: Could not open file …\obj\sys.o: No such file or directory如何解决

笔者的系统是Win10,在搭建32单片机的开发环境时,可谓是一波三折了,重装了几次,遇到最棘手的也就是…\OBJ\USART.axf: error: L6002U: Could not open file …\obj\sys.o: No such file…介个问题了。。
程序用的是商家给的现成的代码,所以程序本身是不存在问题的。

解决该问题要注意:
一、你的keil的安装路径以及系统用户名是否带中文字符以及一些特殊字符,如果带,改了吧。
二、如果不存在上述问题,那么你可能需要修改一下环境变量,因为极有可能是你的环境变量的值存在中文或者特殊字符了,呐~,解决方法如下:

1.在C盘建立一个新的文件夹,命名为英文,如usertemp
2.右击"此电脑",选择属性选项卡,然后点击左侧高级系统设置
3.找到环境变量
在这里插入图片描述

在这里插入图片描述

注意第二张图是笔者已经更改过了的,原来是有中文滴,编辑时将开头的C:\“你的用户名”改为“C:\usertemp”即可,其他的不用动,之后点击确定。
4.重启
5.打开你的keil,编译,就可以成功了。
笔者亲身试验,成功后简直高兴的像个五百斤的孩子!O(∩_∩)O哈哈哈~

什么问题Rebuild started: Project: Template *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'Target 1' compiling core_cm3.c... assembling startup_stm32f10x_hd.s... compiling beep.c... compiling system.c... compiling led.c... compiling misc.c... compiling key.c... compiling SysTick.c... compiling stm32f10x_it.c... compiling main.c... compiling system_stm32f10x.c... compiling stm32f10x_gpio.c... compiling stm32f10x_exti.c... compiling usart.c... compiling exti.c... compiling stm32f10x_rcc.c... linking... .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_ClearFlag (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_Cmd (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_GetFlagStatus (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_GetITStatus (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_ITConfig (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_Init (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_ReceiveData (referred from usart.o). .\Obj\Template.axf: Error: L6218E: Undefined symbol USART_SendData (referred from usart.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 8 error messages. ".\Obj\Template.axf" - 8 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:01
03-17
评论 112
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值