title: Undefined reference to function "CashRegister::GetTotalPrice"
body: <p>I'm trying to call a few functions in a separate class like so;</p>
  
  <pre><code>CashRegister* reg = new CashRegister();
   Subtotal = reg-&gt;GetTotalPrice(Shelf[Choice], Quantity);
              Tax = reg-&gt;GetTax(Subtotal);
              totalCost = Subtotal + Tax;
              cout &lt;&lt; endl &lt;&lt; "Aaah, big spender I see. That's going to cost you..." &lt;&lt; endl;
              cout &lt;&lt; "Subtotal: " &lt;&lt; totalCost &lt;&lt; endl &lt;&lt; "Sales Tax: " &lt;&lt; Tax &lt;&lt; endl &lt;&lt; "Total" &lt;&lt; totalCost &lt;&lt; endl;
  </code></pre>
  
  <p>But I'm getting the error "undefined reference to <code>CashRegister::GetTotalPrice(InventoryItem, int)</code> along with the same errors for the other calls. </p>
  
  <p>Here's CashRegister.h </p>
  
  <pre><code>    #ifndef CASHREGISTER_H_INCLUDED
      #define CASHREGISTER_H_INCLUDED
      #include &lt;string&gt;
      #include "InventoryItem.h"
      using namespace std;
  
      //Constant variables
          const int PROFIT = .3;
          const int SALES_TAX = .06;
      class CashRegister
      {
          public:
          CashRegister();
  
          ~CashRegister();
  
          double GetTotalPrice(InventoryItem myItem, int numPurchased); //Gets the total price and returns it (INC. profit).
          double GetTax(double price); //Calculates sales tax and returns it (JUST the tax)
          double GetProfit(double price); //Adds the profit margin to the item and returns the value
      };
  
  
  #endif // CASHREGISTER_H_INCLUDED
  </code></pre>
  
  <p>I can post the rest if you need it, but its a lot. I would very much appreciate any help!</p>
  
  <p>edit: CashRegister.cpp;</p>
  
  <pre><code>#include "CashRegister.h"
  
  CashRegister::CashRegister()
  {
  
  }
  
  // Destructor
  CashRegister::~CashRegister()
  {
  
  }
  double GetProfit(double price)
  {
      price = price * PROFIT;
      return price;
  }
  
  double GetTax(double price)
  {
      price = price * SALES_TAX;
      return price;
  }
  
  double GetTotalPrice(InventoryItem myItem, double numPurchased)
  {
      double myPrice = myItem.getCost();
      myPrice = myPrice * numPurchased;
      myPrice = GetProfit(myPrice);
      return myPrice;
  }
  </code></pre>