.\Objects\xx.axf: error: L6002U: Could not open file xx.o: No such file or directory error causes and solutions in Keil5

 Reproduced in: Keil MDK5…\OBJ\LED.axf: error: L6002U: Could not open file …\obj\main.o: No such file or directory error causes and solutions- Sunev.cn

When compiling, the following error message suddenly appears:

Usually, this kind of error is caused by the computer system user name having Chinese characters (note the difference between " computer system user name " and " computer name "). Because, Keil MDK will write system variables TEMP and TMP during installation.

If the user name of the computer system contains Chinese characters, Chinese characters will appear in the path of the value in the system variable, causing the Keil MDK software to run incorrectly. So, there are two solutions:

  • (1) Modify the path of the value in the system variables TEMP and TMP,
  • (2) Modify the computer system user name to English.

(a) If your computer is a professional version (under Win10, you can view it by right-clicking on the computer → properties → Windows version), you can use method (1) to solve it, and the specific operations are as follows:

Right-click My Computer\Properties\Advanced System Settings\Environment Variables\User Environment Variables, find the variables TEMP and TMP, replace the "%USERPROFILE%" in the variable value with "C:\user\default", restart the computer, and open it again The project can be compiled successfully! !

(b) If your computer is a home version , using the above method, there will still be compilation errors. Because the home version does not have the default user name by default, it can only be solved by method (2), that is, to modify the computer system user name.

You may have changed the user name of the computer system to English through a series of operations such as the control panel, but found that it is useless, and the problem still occurs. Because the computer system user name modified through the control panel is only the displayed user name, and will not affect the path of the above-mentioned environment variables.

Therefore, there is only one solution, which is to upgrade the home version of windows to the professional version. The upgrade is quite simple, that is, under Win10, you can right click on the computer → properties → Windows activation, enter the product key of the professional version, and wait for activation After that, it became a professional version of the system. At this time, it can be solved by the method in (1); or more thoroughly, change the computer system user name to English. For specific operations, see:

https://blog.csdn.net/qq_45034517/article/details/101672571

Then change the corresponding path in the user variable.

Guess you like

Origin blog.csdn.net/weixin_51659166/article/details/131212518