Search code examples
c++linker-errorslnk2019

LNK2019 Unresolved external symbol OOP and polymorphism?


My project is to build a stack in C++, And I implemented it using array ,but I have 6 Errors: all of them LNK2019 Unresolved external symbol to some functions implementation in the .CPP file I know this is a linker errors , the problem occurred when I Divided My code into Header files .h and implementation files .cpp but the syntax is alright and the program The program has run correctly when I had to test the code in on file :the main file ,any solutions please?

this is the link of code: https://github.com/MohamedYehiaShahin/stack-usin-array-c-


Solution

  • Since you didn't post your code, I can only guess. If you are implementing your stack using a template (very common) then you may see this error if you define your template functions/methods in a separate .cpp file. Typically template functions & classes are defined inline or contain their definitions within the same header file as their declarations.