welcome to
Like that, I finished writing the code at about 0:00. After that, it ran normally twice. When I ran it for the third time, I got this error:
E:\programming\CLion 2022.3.2\bin\mingw\bin/ld.exe: cannot open output file Cprimerplus_0212.exe: Permission denied collect2.exe: error: ld returned 1 exit status
The file E:\C_learning contains an extra file named CPP0212.exe. The code is stored in the file named CPP0212.c. When I tried to delete the exe file, windows denied my access request and told me I needed administrator rights. However, the account I am currently using is an administrator and I have permissions. Other files can be deleted normally.
May I ask why this error occurred? How should I solve this problem?
0 Answer
welcome to
Add
This error says that the output file cannot be opened, possibly because the file is occupied by another process or does not have enough permissions.
Regarding the file being occupied, you can try to shut down other processes that may be using the file. For example, the last run of the program may not have closed completely and caused the file to be occupied. You can also try restarting your computer to make sure no other processes are occupying the file.
On the question of permissions, even if you are using an administrator account, some operations need to be run with administrator permissions to be successful. You can try to delete a file or folder by right-clicking on it and selecting the "Run as administrator" option. If you still can't delete the file, you can try using the command line window to run the delete command as an administrator.
Also, problems with file naming can be caused by not setting the output file name correctly at compile time. You can check the output Settings of the compiler or manually specify the output file name to resolve the problem.
thank you!
This error message indicates that the linker could not open the output file "Cprimerplus_0212.exe" for write operations because the operating system did not grant the appropriate access rights to your account.
Possible cause:
Insufficient permissions: Even if you are an administrator, you need to check the permissions of the folder to make sure that you have permission to write to the file.
Virus or malware: Malware may lock files and prevent you from making changes or deleting them. It is recommended that you use anti-virus software to scan your computer for malware.
Thefile is occupied by another process: another process may have opened the file and locked it. Make sure you close all applications or processes that use this file.
Try the following solution:
Check the folder's permission Settings to make sure you have sufficient permissions to write to the file.
Use anti-virus software to scan the computer for the presence of malware.
Close all applications or processes that use the file and attempt to delete the file.
If none of the above methods solve the problem, you can try booting the computer in safe mode and try deleting the files.
Hope you found these solutions helpful.
这家伙很懒,什么都没留下...