1>main.obj : error LNK2019: unresolved external symbol "public: static void __cdecl Furdarius::MatrixHelpers::inputFromFile<int>(class Furdarius::Matrix<int> &,class std::basic_fstream<char,struct std::char_traits<char> > &)" (??$inputFromFile@H@MatrixHelpers@Furdarius@@SAXAAV?$Matrix@H@1@AAV?$basic_fstream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "class Furdarius::Matrix<int> __cdecl initMatrixFromFile(class std::basic_fstream<char,struct std::char_traits<char> > &)" (?initMatrixFromFile@@YA?AV?$Matrix@H@Furdarius@@AAV?$basic_fstream@DU?$char_traits@D@std@@@std@@@Z)
// MatrixHelpers.h
class MatrixHelpers
{
public:
template<typename _U>
static void inputFromFile(Matrix<_U> &matrix, std::fstream &file);
// MatrixHelpers.cpp
template<typename _U>
void MatrixHelpers::inputFromFile(Matrix<_U> &matrix, std::fstream &file)
{
for (int i = 0; i < matrix.getSize().row; ++i)
for (int j = 0; j < matrix.getSize().col; ++j)
file >> matrix[i][j];
};
Matrix<int> M(size);
MatrixHelpers::inputFromFile<int>(M, file);