问题
so, in sublime text 3, im program a .cpp file, and i'm compiler and there are have :
C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file C:\Users\okera\Desktop\CRUD/main.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
[Finished in 0.8s]
回答1:
This answer is provided with reference to Sublime editor 3 on Windows 10.
The answer to this is that the .exe file is still running in the background which is why you do not have the access to run it again.
There is a simple fix as per my experience.
Step 1: Open Task Manager
Step 2: Open Details Tab ( This is just a sample to show where to go )
Step 3: In your case the the program you want to find in the "Name" Section is main.exe.
Step 4: Once you find it, click on it and click End Task at the bottom right of the Task Manager window.
Step 5: Now, your program has ended its run. Go to Sublime and build your code again.
Your code will run for sure.
Do let me know if any error is still occurring. Thanks.
来源:https://stackoverflow.com/questions/56140030/how-to-fix-permission-denied-collect2-exe-error-ld-returned-1-exit-status-in