Reputation: 1266
So I'm trying to use the Node class that I just wrote in my LinkedList class but I'm getting the error that:
Symbol 'Node' could not be resolved
in the code below.
#ifndef LINKEDLIST_H_
#define LINKEDLIST_H_
#include "Node.h"
template<class T>
class LinkedList {
private:
//Data Fields-----------------//
Node<T> head;
Node<T> tail;
};
#endif /* LINKEDLIST_H_ */
Node's declaration is below:
#ifndef NODE_H_
#define NODE_H_
template<class T>
class Node {
UPDATE:
So I still am having issues with my Node class being included in my LinkedList. But I discovered that by placing the two classes in one header file, I have no problems. So it must mean that the problem lies solely with the inclusion....which confuses me because that makes it seem like its some language based nuance that a beginner to C++ like me doesn't know about..
Upvotes: 0
Views: 295
Reputation: 4988
why do you have the semicolon after #include "Node.h" that's the problem.
Edit: Things you can do to troubleshoot:
Upvotes: 2
Reputation: 1266
So this just randomly started working for me...I don't know what the problem was but it works now... I'm using the CDT with eclipse, and it isn't the most stable thing for C++ development. SO my guess is that it has to do with that somehow....
Upvotes: 0