Class template linker error
<p>I've been trying to create a class cartesian which objects are 2 points on the a cartesian point (int or double). Then I want to overload &lt;&lt;.  I get the error message :</p>

<pre><code>Undefined symbols for architecture x86_64:
  "cartesian&lt;double, int&gt;::cartesian(double, int)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
</code></pre>

<p>I dont understand where is  My mistake.</p>

<p>THE HEADER</p>

<pre><code>#include &lt;iostream&gt;    

using namespace std;

template &lt;class first, class second&gt;
class cartesian
{

public:
    cartesian(first, second);

    //double getslope(cartesian &amp;obj1, cartesian &amp;obj2);

    friend ostream&amp; operator&lt;&lt; (ostream &amp;out, cartesian &amp;cPoint);                

private:
    first x;
    second y;

};
</code></pre>

<p><strong>THE CPP file</strong></p>

<pre><code>#include "cartesian.h"
#include &lt;iostream&gt;

using namespace std;


template&lt;class first,class second&gt;

cartesian&lt;first, second&gt;::cartesian(first a, second b)
:x(a), y(b)
{}

/*
// between obj1 and obj2
template&lt;class first,class second&gt;
double cartesian&lt;first, second&gt;::getslope(cartesian &amp;obj1, cartesian &amp;obj2){

    return ((obj2.y-obj1.y)/(obj2.x-obj1.y));
}

*/


template&lt;class first,class second&gt;

ostream&amp;  operator&lt;&lt; (ostream &amp;out,const cartesian&lt;first, second&gt; &amp;cPoint)
{
    // Since operator&lt;&lt; is a friend of the Point class, we can access
    // Point's members directly.
    out &lt;&lt; "(" &lt;&lt; cPoint.x &lt;&lt; ", " &lt;&lt;
    cPoint.y &lt;&lt; ")";

    return out;
}
</code></pre>

<p>THE MAIN</p>

<pre><code>#include &lt;iostream&gt;
#include "cartesian.h"

using namespace std;

int main()
{

    cartesian&lt;double, int&gt; ob11(3.4, 6);
    return 0;
}
</code></pre>
