I have two branches of in my LinkedList implementation. The Master is a simple one that caters only to integer data types. While the _templates one is designed with templates to provide service to any data type.
My master branch compiles perfectly with this:
g++ -0 t1 main.cpp LinkedList.cpp Node.cpp
On the flip side, when I try to compile my _templates branch with the same (I have the implementation changed in this branch with templates):
g++ -0 t1 main.cpp LinkedList.cpp Node.cpp
I get the Linking error:
undefined reference to `LinkedList<int>::LinkedList()'
undefined reference to `LinkedList<int>::~LinkedList()'
And just to be absolutely clear, my Constructor in _templates branch
template <class T>
LinkedList<T>::LinkedList() {
head = 0;
tail = 0;
}