Hi everybody,
This is my first time with the template class and I have an strange problem. I
have spent all the afternoon trying to understand it, but I don't get the problem...
I have three files:
matrix.cpp (template class)
matrix.h
test.cpp
when I compile as:
g++ -I . *.cpp -shared -o test.so //There is no problem
if I compile as:
g++ -I . *.cpp -o test.o //There is no problem
Then i get this strange message:
g++ -I . *.cpp -o test.o
/tmp/ccrI7vlF.o: In function `main':
test.cpp:(.text+0x77): undefined reference to `Matrix<float>::Matrix(unsigned int)'
collect2: ld returned 1 exit status
I don't know why I get this problem. My main file is:
int main(){
Matrix<float> *vect;
(*vect) = Matrix<float>(3);
}
Can you give my some help ?
THANKS A LOT,
Marcelo
PS: I am attaching the files if someone wants to get a closer view to my
template class.