title: multiple declaration error- virtual functions
body: <p>I have observer.h ,  client.h and field.h files. </p>
  
  <p>In observer.h there is Subject class which has</p>
  
  <pre><code>// observer.h
  
  class Subject  {
  public:
   virtual ~Subject(){};
   Subject(){};
   virtual void Attach(Observer*);
   virtual void Detach(Observer*);
   virtual void Notify(bool _value);
   virtual bool getCheckedIn(){};
  private:
   vector &lt; Observer* &gt;  _observers;
  };
  </code></pre>
  
  <p>&nbsp;</p>
  
  <pre><code>#ifndef CLIENT_H
  #define CLIENT_H
  
  #include "Field.h"
  
  class Client : public Subject {
  public:
   Client(string _name, Field *_field) : client_name(_name) ,field(_field) , checked_in(false) {}
  
   void setCheckedIn(bool _value){
    checked_in = _value;
    Notify(_value);
   }
  
   void enterRow(string _row_name){
    field-&gt;deneme();
    setCheckedIn(true);
   }
  
   bool getCheckedIn(){ return checked_in;}
  private:
   bool checked_in;
   string client_name;
  
   Field *field;
  
  };
  
  #endif // CLIENT_H
  </code></pre>
  
  <p>&nbsp;</p>
  
  <pre><code>#ifndef Field_H
  #define Field_H
  #include "CreateRow_absFac.h"
  #include "observer_pattern.h"
  #include &lt;vector&gt;
  #include &lt;string&gt;
  using namespace std;
  
  // Template Class 
  class Field{
  public:
   Field(); 
   // Template method 
   void field_creator();
   virtual void setAbstractRow() = 0;
  protected:
   FarmFactory *abstract_row1;
   FarmFactory *abstract_row2;
   FarmFactory *abstract_row3;
  
   Rows *row1 ;
   Rows *row2 ;
   Rows *row3 ;
   Sensor sensor1; 
  };
  </code></pre>
  
  <p>When compiled , got this error : </p>
  
  <p>ld: duplicate symbol Subject::Notify(bool) in /Users/barisatamer/Desktop/se311/PROJECT/build/PROJECT.build/Debug/PROJECT.build/Objects-normal/x86_64/Field.o and /Users/barisatamer/Desktop/se311/PROJECT/build/PROJECT.build/Debug/PROJECT.build/Objects-normal/x86_64/main.o</p>
  
  <p>If I remove virtual functions it compiles without error. What is the problem with virtual functions ?</p>