I get this as an error (NOTE: the compiling aspect of the batch file goes without a hitch)
Compile\test.o:test.cpp:(.text+0x178): undefined reference to 'node<int>::node(int)'
Compile\test.o:test.cpp:(.text+0x199): undefined reference to 'nodeList<int>::nodeList(node<int&, int)'
...
And so on and so forth for the destructors and methods.
Now, I know that this is telling me that the prototypes are not implemented, but they are in the .cpp files (down below) are are compiled and linked together using g++. When I put the implementation of the classes in the .h files, it works flawlessly, but I know that this isn't good practice
nodeList.cpp(most omitted because of length restrictions)
1 2 3 4 5 6 7
#include "nodeList.h"
template<typename type>
nodeList<type>::nodeList()
{
//constructor stuff
}
/*omitted implementations, but understand it is there and (hopefully) correctly formatted*/
It means that a template class cannot be divided among different files. Both declaration and implementation are written inside the header file. Your template programming book/tutorial/etc. should have mentioned this. If it didn't, you should be looking for a replacement.