title: C++ inline resulted in undefined reference
body: <p>t.h</p>
  
  <pre><code>#ifndef __T_H__
  #define __T_H__
  
  class A
  {
      int j;
  public:
      A(int i); 
  };
  
  #endif
  </code></pre>
  
  <p>t.cpp</p>
  
  <pre><code>#include "t.h"
  
  inline A::A(int i):j(i){}
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include "t.h"
  
  int main(void)
  {
      A a(2);
  
      return 0;
  }
  </code></pre>
  
  <p>compile:</p>
  
  <pre><code>$ g++ t.cpp main.cpp -o main
  /tmp/ccRjri7I.o: In function `main':
  main.cpp:(.text+0x15): undefined reference to `A::A(int)'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>If I remove the inline from the implementation, it'ok. don't know why is this happen. </p>