I am getting errors trying to compile a C++ template class which is split between a .hpp and .cpp file:
.hpp
.cpp
$ g++ -c -o main.o main.cpp
It is possible, as long as you know what instantiations you are going to need.
Add the following code at the end of stack.cpp and it'll work :
template class stack;
All non-template methods of stack will be instantiated, and linking step will work fine.