I'm making a queue with a linked list. The linked list is two classes and one struct, IList is an abstract class and List inherits from IList. It seems like I can't access my List class from my queue without weird errors.
template <typename T>
class IList{
public:
virtual ~IList();
virtual void add(const T& element) = 0;
//all functions here are pure virtual
};
template <typename T>
class List : public IList<T>{
private:
struct Node{
T data;
Node* next;
};
Node* current;
int nrOfElements;
public:
List();
~List();
List(const List& origObj);
void operator=(const List& origObj);
virtual void add(const T& element);
};
//class definition
All funktions in my List class works fine but when I try to access it from queue.h I get two errors
Error 1 error LNK2019: unresolved external symbol "public: virtual __thiscall IList::~IList(void)" (??1?$IList@H@@UAE@XZ) referenced in function __unwindfunclet$??0?$List@H@@QAE@ABV0@@Z$0
and
Error 2 error LNK1120: 1 unresolved externals
Queue inherits from IQueue and IQueue is an abstract class
template <typename T>
class Queue : public IQueue<T>{
private:
List<T>* aList; //I can't access List via aList->
public:
Queue();
Queue(const Queue& origObj);
void operator=(const Queue& origObj);
virtual ~Queue();
virtual void enqueue(const T& element);
virtual T dequeue() const throw(...);
virtual T& front() throw(...);
virtual bool isEmpty() const;
};