LNK2019 errors

Last edited on
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.

https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl

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.
Last edited on
Topic archived. No new replies allowed.