Timeline for Undefined reference in Eclipse of .h and .cpp files
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 11, 2017 at 7:31 | vote | accept | davidhood2 | ||
Feb 16, 2017 at 8:18 | history | edited | Code Gorilla | CC BY-SA 3.0 |
added 368 characters in body
|
Feb 15, 2017 at 20:40 | comment | added | davidhood2 | @Matt This seems to be correct - inlining, or #include LinkedList.cpp seems to have worked! If you update your answer to reflect the problem? | |
Feb 15, 2017 at 20:05 | comment | added | davidhood2 | I've added the LinkedList.cpp file. Do I take it from this that to solve it I just need to inline all the functions into a single file? | |
Feb 15, 2017 at 13:51 | comment | added | jantje | I have been reading up on this. As Matt states this seems to be a FAQ template issue. Have you read this? isocpp.org/wiki/faq/templates#templates-defn-vs-decl | |
Feb 15, 2017 at 13:02 | comment | added | Code Gorilla | Sorry - The mistake is really obvious, but I had to compile it to realise what it was :) You need the functions implementing. You can't have a cpp file with a template so you need to inline the functions in the header file. (I recreated the error on a PC with Visual Studio, so its not paths) | |
Feb 15, 2017 at 12:52 | comment | added | davidhood2 | Unfortunately they are already both in the same path, and thank you for the tip on namespaces! | |
Feb 15, 2017 at 12:36 | history | answered | Code Gorilla | CC BY-SA 3.0 |