title: Matrix class c++ implementation
body: <p>I am trying to implement a matrix class.</p>
  
  <p><strong>Class Definition</strong></p>
  
  <pre><code>template &lt;typename T&gt;
  class Matrix
  {
  private:
      int size;           //size of matrix
      T value;
      T ** M;
  public:
      Matrix(int m = 2);  
  </code></pre>
  
  <p><strong>Class implementation</strong></p>
  
  <pre><code>/* Matrix constructor */
  template &lt;typename T&gt;
  Matrix&lt;T&gt;::Matrix(int m) : size(m), value(0)
  {
      M = new T*[size];
      for (int i = 0; i &lt; size; i++)
      {
          M[i] = new T[size];
          for (int j = 0; j &lt; size; j++)
          {
              M[i][j] = value;
          }
      }
  }
  </code></pre>
  
  <p>This is how I create an object:</p>
  
  <pre><code>Matrix&lt;int&gt; A = Matrix&lt;int&gt;(3);
  </code></pre>
  
  <p>I keep getting this error: </p>
  
  <blockquote>
    <p>Error 2   error LNK2019: unresolved external symbol "public: __thiscall
    Matrix::Matrix(int)" (??0?$Matrix@H@@QAE@H@Z) referenced in
    function _main</p>
  </blockquote>
  
  <p>Any ideas what can be causing this?</p>