I´m new to c++. i´m getting an error “Symbol ‘List’ could not be resolved”
I´m working on eclipse i can´t figure out what is the problem…
List.h here is the declaration of the father class which is a generic class, which Vector
will inherit
#ifndef LIST_H_
#define LIST_H_
template <class E> class List {
protected:
int size;
public:
virtual ~List();
virtual void add(E o) = 0;
virtual E get(int index) = 0;
int getSize();
};
template <class E> List<E>::~List() {
}
template <class E> int List<E>::getSize() {
return size;
}
#endif /* LIST_H_ */
Vector.h Vector header file, which inherits from List, and it will implement the pure virtual methods of List
im getting the error, when i inherit from List, in the class declaration of Vector, “Symbol ‘List’ could not be resolved”
#include "List.h"
template <class E> class Vector: public List<E>{
private:
class Node {
public:
E value;
Node* next;
Node(E value): value(value), next(0) {}
};
typedef Node* PNode;
PNode first;
public:
Vector();
virtual ~Vector();
void add(E o);
E get(int index);
virtual void add(E o);
virtual E get(int index);
};
Quick search on google yelds that Symbol ‘List’ could not be resolved is not a compilation error, it’s (stupid) eclipse is trying to rebuild a cross reference for you. Try a menu command Index->Rebuild.