C++ Build Issue

Learning C++ on my own at home using Code::Blocks and online tutorials. All was well ( 2-3 weeks )until started getting error messages (below) during build process. Simple programs like the one below now run once, then I get error message. Can someone diagnose this for me? thanks

CODE-----------------------------------------------------------

#include <iostream>
#include <string>

using namespace std;





int main()
{
cout << "boy I love bacon" << endl;

cout << "and ham \n";

cout << "and eggs";

return 0;
}

Build Messages------------------------------------------------------------
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
ld.exe||cannot open output file C:\Users\barry\Documents\CBarry\CProg1\main3Printing.exe Permission denied|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Build Log------------------------------------------------------------------

\main3Printing.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

I think you didn't save your cpp file yet.
Last edited on
The error is saying that there's an instance of your program still running, or some other program opened the binary and has it locked.
Topic archived. No new replies allowed.