title: Fatal error LNK1120 in C++
body: <p>That's my program written in C++ (OOP):</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class  book {
      string name,gvari;
      double cost;
      int year;
  
      public:
          book(){};
  
          book(string a, string b, double c, int d) { a=name;b=gvari;c=cost;d=year; }
          ~book() {}
          double setprice(double a) { return a=cost; }
          friend ostream&amp; operator &lt;&lt;(ostream&amp; , book&amp;);
          void printbook(){
              cout&lt;&lt;"wignis saxeli "&lt;&lt;name&lt;&lt;endl;
              cout&lt;&lt;"wignis avtori "&lt;&lt;gvari&lt;&lt;endl;
              cout&lt;&lt;"girebuleba "&lt;&lt;cost&lt;&lt;endl;
              cout&lt;&lt;"weli "&lt;&lt;year&lt;&lt;endl;
          }
  };
  
  ostream&amp; operator &lt;&lt;(ostream&amp; out, book&amp; a){
      out&lt;&lt;"wignis saxeli "&lt;&lt;a.name&lt;&lt;endl;
      out&lt;&lt;"wignis avtori "&lt;&lt;a.gvari&lt;&lt;endl;
      out&lt;&lt;"girebuleba "&lt;&lt;a.cost&lt;&lt;endl;
      out&lt;&lt;"weli "&lt;&lt;a.year&lt;&lt;endl;
      return out;
  }
  
  class library_card : public book {
      string nomeri;
      int raod;
  
      public:
          library_card(){};
          library_card( string a, int b){a=nomeri;b=raod;}
          ~library_card();
          void printcard(){
              cout&lt;&lt;"katalogis nomeri "&lt;&lt;nomeri&lt;&lt;endl;
              cout&lt;&lt;"gacemis raodenoba "&lt;&lt;raod&lt;&lt;endl;
          }
          friend ostream&amp; operator &lt;&lt;(ostream&amp; , library_card&amp;);
  };
  
  ostream&amp; operator &lt;&lt;(ostream&amp; out, library_card&amp; b) {
      out&lt;&lt;"katalogis nomeri "&lt;&lt;b.nomeri&lt;&lt;endl;
      out&lt;&lt;"gacemis raodenoba "&lt;&lt;b.raod&lt;&lt;endl;
      return out;
  }
  
  
  int main() {
      book A("robizon kruno","giorgi",15,1992);
      library_card B("910CPP",123);
      cout&lt;&lt;A;
      cout&lt;&lt;B;
      A.setprice(15);
      cout&lt;&lt;B;
  
      system("pause");
      return 0;
  }
  
  //P.S.
  //B.printcard();
  //A.printbook();
  // As I've overloaded the "&lt;&lt;" operators, I've removed these two lines and put "cout&lt;&lt;A" "cout&lt;&lt;B". I hope, I'm right. By the way, error isn't related to these ones.
  </code></pre>
  
  <p>Here is the error, it may help you:</p>
  
  <pre><code>1&gt;Neyw.obj : error LNK2019: unresolved external symbol "public: __thiscall library_card::~library_card(void)" (??1library_card@@QAE@XZ) referenced in function _main
  1&gt;c:\users\geo\documents\visual studio 2010\Projects\Newww\Debug\Newww.exe : fatal error LNK1120: 1 unresolved externals
  
  1&gt;Build FAILED.
  </code></pre>
  
  <p>The problem is I can't figure out what's wrong with the code.. There are two classes, the main one, <code>book</code>, and the successor class, <code>library_card</code>. Why does it give me such an error?</p>