Hi folks,
I have a linker - problem using a Matrix-template.
Maybe someone can help me with that.
Q:
"using femath::Matrix" or "using femath::Matrix< double>";
Consider this:
############### ###########
namespace femath {
....
template<class T> class Matrix
{
public:
Matrix();
Matrix(int rows);
Matrix(int rows, int columns);
virtual ~Matrix();
....
};
} //end namespace
namespace fesolv {
using femath::Matrix;
class AbstractSolver
{
public:
AbstractSolver( Model* model);
virtual ~AbstractSolver ();
public:
virtual void Solve()=0;
....
protected:
Model* _model;
Matrix<double>* _systemstiffnes smatrix;
....
};
} //end namespace
############### ###########
Everything compiles great but the linker tells me:
AbstractSolver. obj : error LNK2019: unresolved external symbol "public:
__thiscall femath::Matrix< double>::Matrix <double>(int) "
(??0?$Matrix@N@ femath@@QAE@H@Z ) referenced in function "public:
__thiscall fesolv::Abstrac tSolver::Abstra ctSolver(class fesolv::Model
*)" (??0AbstractSol ver@fesolv@@QAE @PAVModel@1@@Z)
......
I'm using VC++2005 and there is no external *.lib.
Matrix<class T> is in the same compile/link-unit.
Thanks a lot,
Sascha