Hi everyone. I am making a program using templates. I'm not very good with templates. Also, I'm using a makefile. I'm not good with makefiles either. The thing is, when I compile, I receive the following error message:
Code:
main.o(.gnu.linkonce.t._Z9algoritmoI6matriz5vetor9simetricaERT0_RKT1_RKS3_RKT_S9_S9_+0x484): In function `vetor& algoritmo<matriz, vetor, simetrica>(simetrica const&, vetor const&, matriz const&, vetor const&, vetor const&)':
/home/abel/Matriz_com_Templates/metodos.h:144: undefined reference to `vetor& Inverso<vetor>(vetor const&)'
main.o(.gnu.linkonce.t._Z9algoritmoI6matriz5vetor9simetricaERT0_RKT1_RKS3_RKT_S9_S9_+0x6f5):/home/abel/Matriz_com_Templates/metodos.h:156: undefined reference to `vetor& Inverso<vetor>(vetor const&)'
...
it repeats for some other lines. This problem arises when I make a call to a function included in . Those undefined references, are included in . I have included ferramentas.h in the metodos.h. I don't have .cpp for these files. My makefile is the following ( a part of it):
Code:
matriz : matriz.o vetor.o vetor_esp.o esparsa.o simetrica.o metodos.o main.o
g++ -g -o matriz matriz.o vetor.o vetor_esp.o esparsa.o simetrica.o main.o
main.o : testematriz.cpp ferramentas.h metodos.h
g++ -g -c testematriz.cpp -o main.o
metodos.o : metodos.h
g++ -g -c metodos.h
matriz.o : matriz.cpp matriz.h
g++ -g -c matriz.cpp
...
When I call for another function in the same "metodos.h" library, it works.
I don't have a clue of what is going wrong, if anyone can help me, I would be very thankful.
Thank you,
Nepper271.