title: VIsual Studio Code error cannot open output file main.exe
body: <p>This is my first project with Visual Studio Code. When i go to run my &quot;Hello World&quot; project I get this</p>
  <p>cd &quot;c:\Users\imaco\Desktop\Cpppractice&quot; &amp;&amp; g++ main.cpp -o main &amp;&amp; &quot;c:\Users\imaco\Desktop\Cpppractice&quot;main
  c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file main.exe: Permission denied
  collect2.exe: error: ld returned 1 exit status</p>
  <p>my code reads</p>
  <pre><code>1    #include &lt;iostream&gt;
  2
  3
  4
  5     int main()
  6  {
  7   std:: cout &lt;&lt; &quot;Hello World!&quot;;
  8   }
  </code></pre>
  <p>-I've made sure it isn't running in the background.
  -I've closed and reopened the program and ran the code again with same results.
  -I've allowed it as an exception in Bit Defender.</p>
  <p>Any help would be greatly appreciated!!</p>