title: Undefined reference to function (linker error)
body: <p>Hi i read the other questions and answers about undefined reference.But still i'm not able to find out what are the problems with my code. I have a simple linked list code wherein i add the integers to the tail and after that i display them. Here is my code 
  "head.h"</p>
  
  <pre><code>#ifndef __HEAD_H_INCLUDE
  #define __HEAD_H_INCLUDE
  
  class Node {
  int info;
  Node *next;
  };
  
  class imple {
  public:
      imple();
      void addToTail(int );
      void display(void);
  private:
      Node *head,*tail;
  };
  
  #endif
  </code></pre>
  
  <p>"implementaion.cpp"</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include "head.h"
  
  imple::imple(){
  head=tail=0;
  }
  
  void imple::addToTail(int key){
  if(tail==0)
      {tail=head=new Node();
      info=key;next=0;}
  else
  {
      tail-&gt;next=new Node();
      info=key;next=0;
      tail=tail-&gt;next;
  }
  }
  
  void imple::display(){
  Node *temp;
  for(temp=head;temp-&gt;next !=0;temp=temp-&gt;next)
  {
      std::cout&lt;&lt;temp-&gt;info &lt;&lt; "   ";
  }
  }
  </code></pre>
  
  <p>"main.cpp"</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include "head.h"
  
  int main(){
  Node node;
  imple ab;
  for(int i=0;i&lt;5;i++)
  ab.addToTail(i);
  ab.display();
  }
  </code></pre>
  
  <p>Everytime i compile i get this error</p>
  
  <p>"/tmp/cc20Z1ZH.o: In function <code>main':
  lmain.cpp:(.text+0x10): undefined reference to</code>imple::imple()'
  lmain.cpp:(.text+0x2a): undefined reference to <code>imple::addToTail(int)'
  lmain.cpp:(.text+0x45): undefined reference to</code>imple::display()'
  collect2: ld returned 1 exit status"</p>
  
  <p>Your answers and suggestions will be helpful</p>