Undefined symbol
This is probably a really stupid question, but I'm about to flip out just trying to solve it. I have the following code:
(... indicates non-relevant code left out)
in list.h (personal implementation of a linked list):
class ListElement {
...
};
class List {
public:
...
void *Remove(); // Take item off the front of the list
void Remove(ListElement *); // Take the specified list element off the list
ListElement* GetFirst(); // Getter function for first list element
...
};
(in list.cc the corresponding functions are written)
in threadtest.cc:
#include "list.h"
void test::BoardNext(){
List passengerList;
passengerList.Remove(passengerList.GetFirst());
}
I have a make file set up so that it compiles each of files first (which is fine) but then goes to run the following command:
g++ ... list.o threadtest.o ...
which generates the following error before exiting:
Undefined first referenced
symbol in file
List::Remove(ListElement *) threadtest.o
ld: fatal: Symbol referencing errors. No output written to nachos
collect2: ld returned 1 exit status
gmake[1]: Leaving directory `/home/hd03/m/mmorsi/nachos/os/code/threads'
*** Error code 2
gmake[1]: *** [nachos] Error 1
make: Fatal error: Command failed for target `all'
I'm about to tear my hair out here. Am I doing something wrong? I dont get errors for any of the other functions of List which I call in threadtest, just for the Remove(ListElement *)
If someone could help me with this problem, I would be ever so gratefull. Thank you.
|