title: Creating DataType for linked List c++
body: <p>I am trying to create a Linked List where the data in the node is a custom DataType of type <code>Car</code> that holds the arrival time and departure time of cars in a garage. when i run the code i keep getting </p>
  
  <blockquote>
    <p>lnk2019 error: unresolved external symbol "public: __thiscall Car::Car(void)" (??0Car@@QAE@XZ) referenced in function "public: __thiscall CarNode::CarNode(void)" (??0CarNode@@QAE@XZ).</p>
  </blockquote>
  
  <p>here is code:</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class Car
  {
  public:
      Car();
  
      int getArrival()
      {
          return arrival;
      };
  
      int getDeparture()
      {
          return departure;
      };
  
      int arrival = 0;
      int departure = 0;
  };
  
  class CarNode
  {
  public:
      Car data;
      CarNode* next;
  };
  
  class CarLinkedList
  {
  public:
  
      CarLinkedList(Car &amp;e)  
      {
          cout &lt;&lt; "Constructor for Car:  " &lt;&lt; e.getArrival() &lt;&lt; endl;
          head = new CarNode; 
          head-&gt;data = e;
          head-&gt;next = NULL;
      }
  
      void addFront(Car&amp; e)       
      {
          CarNode *v = new CarNode;           
          v-&gt;data = e;                    
          v-&gt;next = head;                 
          head = v;                       
          cout &lt;&lt; "addFront: new head is " &lt;&lt; head-&gt;data.getArrival() &lt;&lt; endl;
      } 
  private:
      CarNode *head;              // pointer to the head of list
  
  };
  
  int main()
  {
      Car chevy;
  
      CarLinkedList *s;
      s = new CarLinkedList(chevy);
      s-&gt;printSLL();
  
      cin.get();
  }
  </code></pre>