title: Undefined reference to destructor error in c++?
body: <p>Here is the class </p>
  
  <pre><code>class Email{
  private:
      char to[100];
      char from[100];
      char subject[200];
      char body[1000];
  
  public:
      Email();
      Email(char *za,char *od,char *tema, char *telo){
      strcpy(to,za);
      strcpy(from,od);
      strcpy(subject,tema);
      strcpy(body,telo);
      }
      ~Email();
      void setTo(char *to) {strcpy(this-&gt;to,to);}
      void setFrom(char *from) {strcpy(this-&gt;from,from);}
      void setSubject(char *subject) {strcpy(this-&gt;subject,subject);}
      void setBody (char *body) {strcpy(this-&gt;body,body);}
      char* getTo () {return to;}
      char* getFrom () {return from;}
      char* getSubject () {return subject;}
      char* getBody () {return body;}
      void print () {
      cout&lt;&lt;"To: "&lt;&lt;to&lt;&lt;endl&lt;&lt;"From: "&lt;&lt;from&lt;&lt;endl&lt;&lt;"Subject: "&lt;&lt;subject&lt;&lt;endl&lt;&lt;body;
      }
  };
  </code></pre>
  
  <p>and as you can see it includes a destructor. The rest of the program is just one function and main.</p>
  
  <pre><code>int checkEmail(char *p){
  int n=0,i=0;
  while(p[i]!='\0')
  {if(p[i]=='@')
  n++;
  i++;}
  if(n==1)
      return 1;
  else return 0;
      }
  
  int main()
  {
      char od[100],za[100],tema[200],telo[1000];
       cout&lt;&lt;"Za: ";
      cin&gt;&gt;za;
      if(checkEmail(za)){
      cout&lt;&lt;"Od: ";
      cin&gt;&gt;od;
      cout&lt;&lt;"Tema: ";
      cin&gt;&gt;tema;
      cout&lt;&lt;"Poraka: ";
      cin&gt;&gt;telo;
      Email o(od,za,tema,telo);
      cout&lt;&lt;"Isprateno: ";
      o.print();
  }
       else cout&lt;&lt;"Pogresna adresa!";
  }
  </code></pre>
  
  <p>It gives an error </p>
  
  <ol>
  <li>obj\Debug\main.o||In function `main':|</li>
  <li>C:\Users\Stefan\Desktop\EMail\main.cpp|58|undefined reference to `Email::~Email()'|</li>
  <li>C:\Users\Stefan\Desktop\EMail\main.cpp|58|undefined reference to `Email::~Email()'|</li>
  <li>||=== Build finished: 2 errors, 0 warnings (0 minutes, 1 seconds) ===|</li>
  </ol>
  
  <p>in the line containing o.print();
  So what is it? Also can sb. tell me how to highlight some lines in my code?</p>