title: LNK2019 Error on overloaded output operator
body: <p>I'm getting the following error from this code:
  Error   1   error LNK2019: unresolved external symbol "class std::basic_ostream > &amp; __cdecl operator&lt;&lt;(class std::basic_ostream > &amp;,class Point const &amp;)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABV?$Point@N@@@Z) referenced in function _main G:\C++ Part II\Final Exam\Point\Point\Source.obj    Point</p>
  
  <p>I know this error typically means that I don't have a function defined, however, it is defined.  The program compiles if I comment out the cout statement in main.  I'm guessing I'm missing something with my Template designation?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  template &lt;class T&gt;
  class Point{
  private:
  T x, y;
  
  public:
  Point(): x(0), y(0) {cout &lt;&lt; "Default Constructor\n";};
  Point(T a, T b): x(a), y(b) {cout &lt;&lt; "Parameterized Constructor\n";};
  Point(const Point &amp;rhs);
  ~Point() {cout &lt;&lt; "Destructor\n";};
  friend ostream &amp;operator&lt;&lt;(ostream &amp;os, const Point&lt;T&gt; &amp;X);
  
  };
  
  int main(){
  Point &lt;double&gt; B;
  cout &lt;&lt; B &lt;&lt; endl;
  
  return 0;
  }
  template &lt;class T&gt;
  Point&lt;T&gt;::Point(const Point &amp;rhs)
  {
  x = rhs.x;
  y = rhs.y;
  cout &lt;&lt; "Copy Constructor\n";
  }
  template &lt;class T&gt;
  ostream &amp;operator&lt;&lt;(ostream &amp;os, const Point&lt;T&gt; &amp;X)
  {
  os &lt;&lt; "(" &lt;&lt; X.x &lt;&lt; ", " &lt;&lt; X.y &lt;&lt; ")";
  
  return os;
  }
  </code></pre>