title: VSCode - C++ undefined reference to 'CLASS::FUNCTION'
body: <p>I'm using VSCode to create a C++ project and keep getting this error when trying to build &amp;&amp; debug. When running from console if I use 'g++ -o main 'main.cpp' 'file_1.cpp' 'file_2.cpp'' it works and compiles correctly.</p>
  
  <p>I have read that this is something to do with the linking of files? Does anyone know how to fix this in VSCode? I have a default launch.json configuration file that builds the active file if this helps.</p>
  
  <p>Here is the contents of my tasks.json file:</p>
  
  <pre><code>{
  "version": "2.0.0",
  "tasks": [
      {
          "type": "shell",
          "label": "shell: g++ build active file",
          "command": "/usr/bin/g++",
          "args": [
              "-g",
              "${file}",
              "-o",
              "${fileDirname}/${fileBasenameNoExtension}"
          ],
          "options": {
              "cwd": "/usr/bin"
          },
          "problemMatcher": [
              "$gcc"
          ],
          "group": {
              "kind": "build",
              "isDefault": true
          }
      },
      {
          "type": "shell",
          "label": "g++ build active file",
          "command": "/usr/bin/g++",
          "args": [
              "-g",
              "${file}",
              "-o",
              "${fileDirname}/${fileBasenameNoExtension}"
          ],
          "options": {
              "cwd": "/usr/bin"
          }
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>EDIT: I'm using Debian 10 'Buster'</p>
  
  <p>Many thanks</p>