#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
gives in the build log
-------------- Build: Debug in tesetst (compiler: GNU GCC Compiler)---------------
Target is up to date.
Nothing to be done (all items are up-to-date).
-------------- Run: Debug in tesetst (compiler: GNU GCC Compiler)---------------
Checking for existence: E:\CodeBlocks\tesetst\bin\Debug\tesetst.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "E:\CodeBlocks\tesetst\bin\Debug\tesetst.exe" (in E:\CodeBlocks\tesetst\.)
Process terminated with status -1073741510 (0 minute(s), 2 second(s))
Now looking at that faq did a complete rebuild and got
-------------- Clean: Debug in tesetst (compiler: GNU GCC Compiler)---------------
Cleaned "tesetst - Debug"
-------------- Build: Debug in tesetst (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -g -std=c++11 -c E:\CodeBlocks\tesetst\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\tesetst.exe obj\Debug\main.o
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot open output file bin\Debug\tesetst.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
But I can't find anything that is running in task manager that would be doing that. I am chalking this up to the fact that I'm a newbie at this. Going to restart PC and see if that does anything... let me know if any of this info gives you a hint as to what it could be.
Thanks so much!
Hi,
looking at the output of the full build log you can see:
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot open output file bin\Debug\tesetst.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
The GNU linker "ld" tells you that it can't open the output file it tries to write (i.e. "bin\Debug\tesetst.exe") because it was denied the permission to do so.
The second stage of the GNU compiler named "collect2.exe" tells you that the compilation was not successful because the linker "ld" returned an error code
of "1".
I would bet that there doesn't exist any "tesetst.exe" program in the output directory "bin\Debug" relative to the project directory.
Such kind of error is often caused by overeager antivirus programs. They commonly don't like programs that dynamically generate code. But that is the
purpose of a compiler. Disable your antivirus program and do a full rebuild (without run) and inspect the log for errors and the output directory for a generated output file.
In any case make sure that you have write permissions in the output directories "obj\Debug" and "bin\Debug" relative to the project directory.
Perhaps that helps.
pirx67