Codeblocks, C++ build: Permission denied collect2.exe

大城市里の小女人 提交于 2019-12-11 17:45:38

问题


I'm trying to build and run a C++ source file with 2 header files in Codeblocks (Windows). I built a Codeblocks project to do so (this is the 1st time). I have also looked online for solutions on settings but I keep getting same message. This is the build log:

cannot find C:\Users\cs106: Permission denied collect2.exe: error: ld returned 1 exit status

search directories/compiler: "C:\MinGW\bin" search directories/linker: "C:\MinGW\bin" search directories/resource compiler: "C:\MinGW\bin"

I attach a picture of my project as well. In what field do I specify where to find this *.exe file?

My latest build log is the following:

-------------- Build: Debug in CS106v3.2 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\MinGW\bin -LC:\MinGW\bin -o bin\Debug\CS106v3.exe obj\Debug\main.o "C:\Users\E\Documents\Algorithm\C++ S\cs106" C:\MinGW mingw32-g++.exe: error: C:\Users\E\Documents\Algorithm\C++ S\cs106: No such file or directory Process terminated with status 1 (0 minute(s), 0 second(s)) 1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Yet I do not refer anywhere to "C:\Users\E\Documents\Algorithm\C++ S\cs106". Why is it looking in that folder?


回答1:


This error message "Permission denied" collect2.exe is because the codeblocks console application is still running in the background. On windows 8: right click on the menu bar at the bottom of your screen. Then click "Task Manager" Under Processes. Locate on the the processed named "Console window Host" Right click on it and click "End Task" Click in the check box "Abandon unsaved data and shut down" Then click on "Shutdown" You should be good after that.




回答2:


Look in the process manager, your "CS106v3.exe" maybe still running there (mine was "study.exe", by the name of a project). You have to kill it. Sorry for such a silly answer, this happened to me because of an error in the code i was writing. I'm new to c++, happens to me everytime.



来源:https://stackoverflow.com/questions/22921297/codeblocks-c-build-permission-denied-collect2-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!