title: i cant C++ run vscode
body: <p>I need help.</p>
  <p>I installed Visual Studio Code, then I installed the latest version of MingW for C++ programming.</p>
  <p>When I try to  run the program, I got an error: <code>&quot;cc1plus is not detected&quot;</code>.
  I tried to fix it on my own by putting the directory in the system environment variables.</p>
  <p>Then I received another error:
  <code>main': C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to WinMain' collect2.exe: error: ld returned 1 exit status PS C:\Users\angel\OneDrive\Documents\Visual Studio Code\PRogramming WorkSpace\C++&gt;</code></p>
  <p>I don't understand what this error means.
  I hope someone can help me solve this problem.</p>
  <p>My Code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;  
  using namespace std;
    
  int main()
  {
      cout &lt;&lt; &quot;Hello World!&quot;;
      return 0;
  }   
  </code></pre>
  <p>Output:</p>
  <pre><code>PS C:\Users\angel\OneDrive\Documents\Visual Studio Code\PRogramming WorkSpace&gt; cd &quot;c:\Users\angel\OneDrive\Documents\Visual Studio Code\PRogramming WorkSpace\C++\&quot; ; if ($?) { g++ test.cpp -o test } ; if ($?) { .\test }
  
  C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
  C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
  collect2.exe: error: ld returned 1 exit status
  PS C:\Users\angel\OneDrive\Documents\Visual Studio Code\PRogramming WorkSpace\C++&gt; 
  </code></pre>