I'm doing a simple program and I'm using templates in C++ to implement a library with a few data types when I don't find the way to compile it.
The code is:
VectorT.cpp file:
template <class T>
VectorT<T>::VectorT(){
elementos = NULL;
numElementos=0;
}
VectorT.h file :
#ifndef __VectorT_h__
#define __VectorT_h__
template <class T>
class VectorT{
private:
T * elementos;
int numElementos;
public:
VectorT();
};
#include "VectorT.tpp"
#endif
And the compile way, with the error:
g++ -c -o obj/VectorT.o src/VectorT.cpp -I include/VectorT.h
g++: warning: src/VectorT.cpp: linker input file unused because linking not done
Any idea? Thank you so much.