title: Cannot open output file, permission denied
body: <p>So I keep getting this error when trying to compile C++ code using CodeBlocks.</p>
  
  <blockquote>
    <p>cannot open output file [filename.exe] permission denied</p>
  </blockquote>
  
  <p>It only started today, and it's sporadic and inconsistent.  It usually goes away if I shut CodeBlocks down and restart the project, but not always.  Sometimes it even goes away when I just press F9 (build &amp; run) several times.  I always check Task Manager, but there are never any .EXEs running with my file's name, or anything related to it.  </p>
  
  <p>I've also noticed that if this problem occurs and I then try to delete the .EXE manually or otherwise interact with it, Windows tells me I need administrator permission to do so (this is a private PC, and as far as I know I am an administrator on it).</p>
  
  <p>The first time it occurred, the only thing I had added to the code beyond what was in the previous version was a debugging report sent to cout - hardly anything arcane.  It sometimes occurs even when no code was changed from a previous version.</p>
  
  <p>What could this be?  It's not game-breaking, yet, but it's irritating and I'd rather it didn't get worse.</p>
  
  <p>EDIT: This is old by now, but just in case anyone else is having similar problems, the workaround I currently use is just to consistently delete [filename.exe] before trying to run the code again.  This avoids the problem, though it is annoying.</p>