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
Only if you #include "stack.cpp at the end of stack.hpp. I'd only recommend this approach if the implementation is relatively large, and if you rename the .cpp file to another extension, as to differentiate it from regular code.
#include "stack.cpp
stack.hpp