title: Permission denied - cannot open outputfile
body: <p>Now and then I get this compilation error when compiling a c-file in Eclipse.</p>
  
  <p><strong><em>c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot open output file main.exe: Permission denied</em></strong></p>
  
  <p>It happends when I have made a change in the source-code - but not always.</p>
  
  <p>I know how to solve this* but I would like to know WHY it occurs and how to avoid it?</p>
  
  <p>*<em>In eclipse I go to the debugger and terminate the main thread of  the program</em></p>