1

so im getting this error

Error   1   error LNK2019: unresolved external symbol "public: enum LL_ERR __thiscall linkedList<int>::addData(int)" (?addData@?$linkedList@H@@QAE?AW4LL_ERR@@H@Z) referenced in function "public: enum S_ERROR __thiscall stack<int>::push(int const &)" (?push@?$stack@H@@QAE?AW4S_ERROR@@ABH@Z)  C:\Users\Spyder\Documents\Visual Studio 2010\Projects\stack_ll\stack_ll\stack__ll.obj   stack_ll

plus the same errors for each function I call that is in the linked list

I have 4 files. a linked_list.h, linked_list.cpp, stack_ll.h, stack_ll.cpp Linked_list.h has the class definition. linked_list.cpp has all the functions of said class. stack_ll.h has another class for a stack that stores everything using the linked list. and finally stack_ll.cpp that has the functions for the stack plus main(). For some reason the linker is saying that none of the functions of the linked list class have been defined. linked_list.cpp is included in the project. Any help would be greatly appreciated.

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
lesyriad
  • 19
  • 1

1 Answers1

3

You haven't shown the code, but the problem is almost certainly that you've defined some class-template member functions in your .cpp file, rather than your .h file.

See the C++ FAQ: How can I avoid linker errors with my template classes?.

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680