After compiling, I receive this error in terminal upon execution:
Undefined symbols for architecture x86_64:
"DoubleLinkedList<int>::insertBack(int)", referenced from:
Queue::enqueue(int) in Queue-ccbd45.o
"DoubleLinkedList<int>::removeFront()", referenced from:
Queue::dequeue() in Queue-ccbd45.o
"DoubleLinkedList<int>::peek()", referenced from:
Queue::peek() in Queue-ccbd45.o
"DoubleLinkedList<int>::DoubleLinkedList()", referenced from:
Queue::Queue() in Queue-ccbd45.o
"DoubleLinkedList<int>::~DoubleLinkedList()", referenced from:
Queue::~Queue() in Queue-ccbd45.o
ld: symbol(s) not found for architecture x86_64
I have scoured the web for solutions, and none have worked yet.
To my understanding, either the signature declaration does not match the signature definition, or I am not linking to the library correctly.
My Queue source code is simple:
Queue::Queue() {
}
Queue::~Queue() {
}
void Queue::enqueue(int data) {
myDLL.insertBack(data);
}
int Queue::dequeue() {
return myDLL.removeFront();
}
int Queue::peek() {
return myDLL.peek();
}
Where myDLL is an instance of a DoubleLinkedList in the Queue class.
My DoubleLinkedList class is a template class using T, so in my main I build the queue using this:
DoubleLinkedList<int> myDLL;