[try Beta version]
Not logged in

 
LNK2019 errors

Oct 15, 2017 at 7:00am
Last edited on Oct 16, 2017 at 4:19am
Oct 15, 2017 at 7:29am
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.
Oct 15, 2017 at 7:32am
Last edited on Oct 15, 2017 at 7:34am
Topic archived. No new replies allowed.