title: Compiling C++ code in Visual Studio Code
body: <p>I installed the recommended C/C++ extension made by Microsoft. I wish to now fix compiling.</p>
  
  <p>I know visual studio code is an editor with no inbuilt compiler, however there is little to no information as to how to achieve a task of fix the configuration to be able to compile code.</p>
  
  <p>I run linux ubuntu 14.04 and have gcc compiler installed. I wish to use this to compile the code.</p>
  
  <p>I've ben looking at tasks and when in debug mode when launching it takes to this file:</p>
  
  <p>lanuch.json (these are launch configurations):</p>
  
  <pre><code>{
      "version": "0.2.0",
      "configurations": [
          {
              "name": "C++ Launch (GDB)",
              "type": "cppdbg",
              "request": "launch",
              "launchOptionType": "Local",
              "targetArchitecture": "x64",
              "program": "enter program name, for example ${workspaceRoot}/a.out",
              "args": [],
              "stopAtEntry": false,
              "cwd": "${workspaceRoot}",
              "environment": [],
              "externalConsole": true
          },
          {
              "name": "C++ Attach (GDB)",
              "type": "cppdbg",
              "request": "launch",
              "launchOptionType": "Local",
              "targetArchitecture": "x64",
              "program": "enter program name, for example ${workspaceRoot}/a.out",
              "args": [],
              "stopAtEntry": false,
              "cwd": "${workspaceRoot}",
              "environment": [],
              "processId": "enter program's process ID",
              "externalConsole": false
          }
      ]
  }
  </code></pre>
  
  <p>From here I'm lost. I don't actually know what to change here.</p>
  
  <p>Also from this <a href="https://code.visualstudio.com/docs/editor/tasks" rel="nofollow">https://code.visualstudio.com/docs/editor/tasks</a> there is an example of a task:</p>
  
  <pre><code>{
      "version": "0.1.0",
      "command": "gcc",
      "args": ["-Wall", "helloWorld.c", "-o", "helloWorld"],
      "problemMatcher": {
          "owner": "cpp",
          "fileLocation": ["relative", "${workspaceRoot}"],
          "pattern": {
              "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
              "file": 1,
              "line": 2,
              "column": 3,
              "severity": 4,
              "message": 5
          }
      }
  }
  </code></pre>
  
  <p>Again I don't know how to edit this so that it will compile my code.</p>
  
  <p>I have the file start.cpp which includes my main function.</p>
  
  <p><strong>So how does one setup visual studio code to compile code in the easiest and most automated way?</strong></p>