You can't separate template classes into different .h/.cpp files seeing as templates need to be instantiated at compile time before the linker gets to do anything.
The common solutions to this are either keep everything in your header file or if you want to keep declaration/definition separate use another header file like MyStack.hpp and put your definitions there and include it in MyStack.h.