title: Visual Studio Code cannot find the g++.exe (Windows 10)
body: <p>I am setting up the vs code on my windows pc by following this <a href="https://code.visualstudio.com/docs/cpp/config-mingw" rel="nofollow noreferrer">tutorial</a>.</p>
  
  <p>I checked the path is correct by calling g++ from other folder.</p>
  
  <p>But I keep getting this error on vs code:</p>
  
  <pre><code>Cannot find "C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw64\bin\g++.exe".
  </code></pre>
  
  <p>tried to run <code>g++ helloworld.cpp</code> using command prompt from the folder where <code>helloworld.cpp</code> is located does not give error nor output.</p>
  
  <p>Can anyone show me where I did miss something?</p>
  
  <p>EDIT:</p>
  
  <p>The code is actually compiled already.
  It produces a.exe and it runs well.
  The problem is I need it to be integrated into vs code.
  I guess it is similar like <a href="https://stackoverflow.com/questions/46718765/visual-studio-code-cannot-find-the-g-command-of-my-mingw-w64">this</a> but I am not sure.</p>
  
  <p><strong>c_cpp_properties.json</strong></p>
  
  <pre><code>{
  "configurations": [
      {
          "name": "Win32",
          "includePath": [
              "${workspaceFolder}/**"
          ],
          "defines": [
              "_DEBUG",
              "UNICODE",
              "_UNICODE"
          ],
          "compilerPath": "C:/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw64/bin/g++.exe",
          "cStandard": "c11",
          "cppStandard": "c++17",
          "intelliSenseMode": "clang-x64"
      }
  ],
  "version": 4
  </code></pre>
  
  <p>}</p>
  
  <p><strong>tasks.json</strong> corrected</p>
  
  <pre><code>{
  // See https://go.microsoft.com/fwlink/?LinkId=733558 
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
      {
          "type": "shell",
          "label": "g++.exe build active file",
          "command": "g++",
          "args": [
              "-g",
              "-o",
              "helloworld",
              "helloworld.cpp"
          ],
  
          "group": {
              "kind": "build",
              "isDefault": true
          }
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p><strong>tasks.json</strong></p>
  
  <pre><code>    {
  // See https://go.microsoft.com/fwlink/?LinkId=733558 
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
      {
          "type": "shell",
          "label": "g++.exe build active file",
          "command": "g++",
          "args": [
              "-g",
              "${file}",
              "-o",
              "${fileDirname}/${fileBasenameNoExtension}.exe",
              "helloworld",
              "helloworld.cpp"
          ],
          "options": {
              "cwd": "C:/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw64/bin/"
          },
          "problemMatcher": [
              "$gcc"
          ],
          "group": {
              "kind": "build",
              "isDefault": true
          }
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p><strong>settings.json</strong></p>
  
  <pre><code>{
  "[cpp]": {},
  "terminal.integrated.shell.windows": "C:\\cygwin64\\bin\\bash.exe"
  </code></pre>
  
  <p>}</p>
  
  <p><strong>launch.json</strong></p>
  
  <pre><code>{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
      {
          "name": "(gdb) Launch",
          "type": "cppdbg",
          "request": "launch",
          "program": "${workspaceFolder}/helloworld.exe",
          "args": [],
          "stopAtEntry": false,
          "cwd": "${workspaceFolder}",
          "environment": [],
          "externalConsole": true,
          "MIMode": "gdb",
          "miDebuggerPath": "C:/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw64/bin/g++.exe",
          "setupCommands": [
              {
                  "description": "Enable pretty-printing for gdb",
                  "text": "-enable-pretty-printing",
                  "ignoreFailures": true
              }
          ]
      }
  ]
  </code></pre>
  
  <p>}</p>