关于undefined reference to 问题
ab.h文件有这么一段定义
class Matrix : public GeneralMatrix // usual rectangular matrix
{
GeneralMatrix* Image() const; // copy of matrix
public:
Matrix() {}
~Matrix() {}
Matrix(int, int); // standard declaration
Matrix(const BaseMatrix&); // evaluate BaseMatrix
void operator=(const BaseMatrix&);
void operator=(Real f) { GeneralMatrix::operator=(f); }
void operator=(const Matrix& m) { operator=((const BaseMatrix&)m); }
...
...
};
主函数k.cpp 下面这段代码出错
Matrix xhat(n,1);
Matrix phi(n,n);
Matrix z(m,1);
错误信息是类似undefined reference to `Matrix::Matrix(int, int)'
请问如何解决?