title: Trying to run separated classes in vs code in c++
body: <p>I am new to vs code, after previously using atom a little bit. I am working on c++ with a program that has some classes in separated files. I have already installed the c/c++ extension, but I am facing a problem. When I try to run the program with all it's files included, it shows me the following error:</p>
  
  <p>main.cpp:(.text+0x1f): undefined reference to `Car::sayHello()'
     collect2: error: ld returned 1 exit status.
  the code is pretty basic.</p>
  
  <pre><code> #include &lt;iostream&gt;
   #include "Car.h"
  
   using namespace std;
   int main(){
       Car c;
       c.sayHello();
        cout &lt;&lt; "Hello world";
        return 0;
    }
  </code></pre>
  
  <p>From what I remember from atom, selecting all the files and running them would solve the problem, which I think is the same as running the following command in the terminal:</p>
  
  <pre><code> g++ Car.cpp Car.h main.cpp -o Classes
  </code></pre>
  
  <p>I have tried these in vs code and the problem seems to appear again. Help is much appreciated.</p>