# Undefined Reference

Show 30 post(s) from this thread on one page
Page 2 of 2 First 1 2
• 07-16-2003
bignester
heres this
Code:

```#include "Matrix.h" template <class T> Matrix<T>&#58;&#58;Matrix&#40;&#41; &#123; &#125; template <class T> Matrix<T>&#58;&#58;Matrix&#40;Matrix <T> &copy&#41; &#123; &#125; template <class T> Matrix<T>&#58;&#58;Matrix&#40;int r,int c&#41; &#123;   mat.resize&#40;r&#41;;   for&#40;int i=0;i<r;i++&#41; &#123;     mat&#91;i&#93;.resize&#40;c&#41;;   &#125; &#125; template <class T> Matrix<T>&#58;&#58;~Matrix&#40;&#41; &#123; &#125; template <class T> Matrix<T>&#58;&#58;Matrix&#40;vector< vector<T> > &v&#41; &#123;   &#125; template <class T> Matrix<T>&#58;&#58;Matrix&#40;T **v,int r,int c&#41; &#123;   mat.resize&#40;r&#41;;   for&#40;int i=0;i<r;i++&#41; &#123;     mat&#91;i&#93;.resize&#40;c&#41;;   &#125;     for&#40;int i=0;i<r;i++&#41; &#123;     for&#40;int j=0;j<c;j++&#41; &#123;       mat&#91;i&#93;&#91;j&#93; = v&#91;i&#93;&#91;j&#93;;     &#125;   &#125; &#125; template <class T> void Matrix<T>&#58;&#58;Set_Rows&#40;int r&#41; &#123;   mat.resize&#40;r&#41;; &#125; template <class T> void Matrix<T>&#58;&#58;Set_Cols&#40;int c&#41; &#123;   for&#40;int i=0;i<mat.size&#40;&#41;;i++&#41;     mat&#91;i&#93;.resize&#40;c&#41;; &#125; template <class T> void Matrix<T>&#58;&#58;Set&#40;T v,int r,int c&#41; &#123;   mat&#91;r&#93;&#91;c&#93; = v; &#125; template <class T> T& Matrix<T>&#58;&#58;Get&#40;int r,int c&#41; const &#123;   return mat&#91;r&#93;&#91;c&#93;; &#125; template <class T> int Matrix<T>&#58;&#58;Get_R_Size&#40;&#41; &#123;   return mat.size&#40;&#41;; &#125; template <class T> int Matrix<T>&#58;&#58;Get_C_Size&#40;&#41;&#123;   return mat&#91;0&#93;.size&#40;&#41;; &#125; template <class T> void Matrix<T>&#58;&#58;Clear&#40;&#41;&#123; &#125;```
• 07-16-2003
bignester
for some strange reason i had to include the matrix.cpp file instead the matrix.h file. anyway i got it to work thanx for the help.
Show 30 post(s) from this thread on one page
Page 2 of 2 First 1 2