title: VS2010 fatal error LNK1120: 1 unresolved externals
body: <p>I've been working on this for a while now and I can't seem to figure it out. I cannot compile the code as it keeps throwing the below error. Basically what Im trying to do is create a vector which contains objects from both a base and derived class using pointers. </p>
  
  <p>Final Assignment.obj : error LNK2019: unresolved external symbol "public: __thiscall Product::Product(void)" (??0Product@@QAE@XZ) referenced in function "public: __thiscall SaleProduct::SaleProduct(char,class std::basic_string,class std::allocator >,int,double,double)" (??0SaleProduct@@QAE@DV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HNN@Z)<br>
  fatal error LNK1120: 1 unresolved externals</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;iomanip&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  using namespace std;
  
  class Product
  {
  
  
  public:
  
  Product();
  Product(char iT,string des,int inv,double p,double dis)
  {
  invType = iT;
  description = des;
  inventory = inv;
  price = p;
  discount = dis;
  }
  
  char getInvType(){
  return invType;
  }
  
  protected:
  char invType ;
  string description;
  int inventory;
  double price;
  double discount;
  };
  
  class SaleProduct:public Product {
  
  public:
  
  
  
  //SaleProduct();
  SaleProduct(char iT,string des,int inv,double p,double dis){
  
  
  }
  
  
  };
  
  
  
  int main()
  {
  int choice = 0;
  // SaleProduct* SaleProductOB;
  // Product *productPoint = &amp;ProductOB;
   vector&lt;Product*&gt; inventoryVec;
  
    char invType;
    string description;
    int inventory;
    double price;
    double discount = 0;
  
  
  
  
  ifstream inFile("Inventory.txt");
  
  if (inFile.is_open()){
  
  while (inFile &gt;&gt; invType &gt;&gt; description &gt;&gt; inventory &gt;&gt; price &gt;&gt;discount){
  
        if (invType == 'S'){
  
             inventoryVec.push_back(new SaleProduct(invType,description,inventory,price,discount)  );
       }else{
      //inventoryVec.push_back(new Product(invType,description,inventory,price,discount)  );
  
        }
  
  }
  }else{
  cout &lt;&lt; "File is not ready!";
  }
  
  
  
  cout &lt;&lt; inventoryVec.size() &lt;&lt; endl;
  
  
  while (choice != 3) {
          cout &lt;&lt; "Please enter your choice:" &lt;&lt; endl;
          cout &lt;&lt; "1. Print available items"  &lt;&lt; endl;
          cout &lt;&lt; "2. Add item to cart"       &lt;&lt; endl;
          cout &lt;&lt; "3. Print receipt and quit" &lt;&lt; endl &lt;&lt; endl;
  
          cin &gt;&gt; choice;
   }
  
  
  
  
  
  
  
  
  //system("PAUSE");
  return 0;
  }
  </code></pre>