Node does not name a type error
<p>I have searched through the other questions and none of them seem to apply 
exactly. 
I am writing a program that finds a route through a maze,
the only real thing im having a problem with is this one compiler error. 
It has to do with the one function I have the returns a Node ( struct). </p>

<p>Header file: (I cut the define stuff off)</p>

<pre><code> #include &lt;iostream&gt;
    #include &lt;string&gt;
    using namespace std;


    class Graph {

    private:

        struct Node {
            int id; //int id
            Node * north;   //north path node
            Node * south;   //south path node
            Node * east;        //east path node
            Node * west;        //went path node
            bool visited;   // visited bool 
        };

        //this struct holds the path that is found. 
        struct Elem {
            int id;         //The id of the node
            string last;    //the door that it passed through
            Elem * back;        //back one path         
            Elem * next;    //forward one path 
        };

        //This is a graph with a very smart struct

        //This is the main node that makes up the graph. 


        Node * start;

        Node ** initArr;
        int arrLen; 

        Elem * head;
        Elem * tail; 

        int path; 

    public:

        Graph();
            //Constructs empty graph

        Graph(const Graph &amp;v);
            //copy constructor

        ~Graph();
            //destructor

        Graph &amp; operator = (const Graph &amp;v);
            //assignment operator 

        void output(ostream &amp; s) const; 
            //Prints the graph

        void input(istream &amp; s); 
            //input and creates the graph

        Node * find(int id);
            //finds the node in the graph

        void makePath();    
            //makes a path through the maze

        bool findPath(Node* cur, string room);  
            //worker function for recursion

        void pathOut(ostream &amp; s) const; 
            //Outputs the found path 

        void removeTail();
            //Removes the last element

        void addTail(Node* n, string door); 
            //Adds the element to the tail 

        //Mutators 
        void setId(Node* n ,int x);
        void setVisited(Node* n, bool v); 



        //Elem Mutator
        void seteId(Elem* e, int x); 

        //Elem Accessor
        int geteId(Elem* e);

        //Accessors
        int getId(Node* n);
        bool getVisited(Node* n); 




    };
</code></pre>

<p>And my actual code file. </p>

<pre><code>    #include &lt;iostream&gt;
    #include "graph.h"
    using namespace std;

        //Constructs empty graph
        Graph::Graph()
        {
            start = 0;
            head = tail = 0; 
            path = 0; 
        }

        //copy constructor  
        Graph::Graph(const Graph &amp;v)
        {
            //not implemented
        }

        //destructor    
        Graph::~Graph()
        {
            for(int i = 0; i &lt; arrLen + 1; i++)
            {
                delete initArr[i];  
            }


            while(head != 0)
            {
            Elem* p = head;
            head = head-&gt;next;
            delete p;
            }

            delete[] initArr; 
        }

        //assignment operator   
        Graph &amp; Graph::operator = (const Graph &amp;v)
        {
            //not implemented
        }

        //Prints the graph  
        void Graph::output(ostream &amp; s) const
        {
            s&lt;&lt;"Node"&lt;&lt;'\t'&lt;&lt;"North"&lt;&lt;'\t'&lt;&lt;"East"&lt;&lt;'\t'&lt;&lt;"South"&lt;&lt;'\t'&lt;&lt;"West"&lt;&lt;'\n';
            for(int i = 1; i &lt; arrLen + 1; i++)
            {
                Node* temp = initArr[i];
                s&lt;&lt;temp-&gt;id&lt;&lt;'\t';

                if(temp-&gt;north != 0)
                    s&lt;&lt;temp-&gt;north-&gt;id&lt;&lt;'\t'; 
                else
                    s&lt;&lt;"--"&lt;&lt;'\n';

                if(temp-&gt;east != 0)
                    s&lt;&lt;temp-&gt;east-&gt;id&lt;&lt;'\t'; 
                else
                    s&lt;&lt;"--"&lt;&lt;'\n';

                if(temp-&gt;south != 0)
                    s&lt;&lt;temp-&gt;south-&gt;id&lt;&lt;'\t'; 
                else
                    s&lt;&lt;"--"&lt;&lt;'\n';

                if(temp-&gt;west != 0)
                    s&lt;&lt;temp-&gt;west-&gt;id&lt;&lt;'\t'; 
                else
                    s&lt;&lt;"--"&lt;&lt;'\n';

                s&lt;&lt;'\n';


            }

        }

        //input and creates the graph   
        void Graph::input(istream &amp; s)
        {
            int length = 0;
            s&gt;&gt;length;
            arrLen = length; 
            if(s)
            {

                //define array
                initArr = new Node*[length + 1];
                int temp = 0; 
                for(int i = 1; i &lt; length + 1; i++)
                {
                    //Create node                   
                    s&gt;&gt;temp; 
                    Node* n = new Node; 
                    n-&gt;id = temp; 
                    n-&gt;visited = false; 
                    //Add to array 
                    initArr[i] = n;
                }

                //Make Exit Node
                Node *x = new Node; 
                x-&gt;id = 0;
                x-&gt;visited = false; 
                initArr[0] = x; 

                //Loop through all of the node input
                int tn = 0;
                for(int f = 0; f &lt; length; f++)
                {
                    //Set Pointers
                    s&gt;&gt;tn;
                    Node* curNode = find(tn); 
                    int n = 0;
                    int e = 0;
                    int st = 0;
                    int w = 0;
                    s&gt;&gt;n&gt;&gt;e&gt;&gt;st&gt;&gt;w; 
                    curNode-&gt;north = find( n ); 
                    curNode-&gt;east = find( e );
                    curNode-&gt;south = find( st );
                    curNode-&gt;west = find( w );
                }
                //set Entry point to graph
                int last = 0;
                s&gt;&gt;last; 
                start = find(last); 

            }   
        }

        //finds the node in the array
        Node* Graph::find(int id)
        {
            if( id == 0)
            {
                return initArr[0]; 
            }
            if(id == -1)
            {
                return 0; 
            }
            else
            {
                for(int i = 1; i &lt; arrLen + 1; i++)
                {
                    if(initArr[i]-&gt;id == id)
                    {
                        return initArr[i]; 
                    }

                }
                cerr&lt;&lt;"NOT FOUND IN GRAPH";
                return 0; 
            }
        }

        //makes a path through the maze
        void Graph::makePath()
        {
            if(findPath(start-&gt;north, "north") == true)
            {
                path = 1; 
                return; 
            }
            else if( findPath(start-&gt;east, "east") == true)
            {
                path = 1;
                return;
            }
            else if( findPath(start-&gt;south, "south") == true)
            {
                path = 1;
                return;
            }
            else if( findPath(start-&gt;west, "west") == true)
            {
                path = 1;
                return;
            }
            return; 
        }


        //finds a path to the outside
        bool Graph::findPath(Node* cur, string room)
        {
            addTail(cur, room);

            if(cur = initArr[0])
            {
                    return true;
            }

            if(cur-&gt;north != 0 &amp;&amp; cur-&gt;north-&gt;visited == false)
            {
                    cur-&gt;visited = true; 
                    findPath(cur-&gt;north, "north");
            }
            else if(cur-&gt;east != 0 &amp;&amp; cur-&gt;east-&gt;visited == false)
            {
                    cur-&gt;visited = true; 
                    findPath(cur-&gt;north, "east");
            }
            else if(cur-&gt;south !=0 &amp;&amp; cur-&gt;south-&gt;visited == false)
            {
                    cur-&gt;visited = true; 
                    findPath(cur-&gt;north, "south");
            }
            else if(cur-&gt;west != 0 &amp;&amp; cur-&gt;west-&gt;visited == false)
            {
                    cur-&gt;visited = true; 
                    findPath(cur-&gt;north, "west");
            }
            else
            {
                cur-&gt;visited = false; 
                removeTail(); 

            }
        }

        //Outputs the found path 
        void Graph::pathOut(ostream &amp; s) const
        {
            if(path == 1)
            {
                Elem *p;
                p = head-&gt;next;

                while(p != 0)
                {
                    s&lt;&lt;p-&gt;id&lt;&lt;"--&gt; "&lt;&lt;p-&gt;last;
                    p= p-&gt;next;
                }
            }
            else if(path == 0)
            {   

            }

        }

        //Removes the last element in the chain         
        void Graph::removeTail()
        {
            Elem* temp = 0;
            temp = tail;
            tail = tail-&gt;back;
            delete temp; 
        }   

        //Adds the element to the tail
        void Graph::addTail(Node* n, string door)
        {
            if(head != 0)
            {
                Elem* temp = new Elem;
                temp-&gt;id = n-&gt;id; 
                tail-&gt;next = temp;
                tail-&gt;last = door; 
                temp-&gt;back = tail;
                temp-&gt;next = 0;
                tail = 0; 
            }
            else
            {
                Elem *p = new Elem;
                p-&gt;last = "";
                p-&gt;back = 0; 
                p-&gt;next = 0; 
                head = p; 
                tail = p; 
            }

        }


        //Mutators 
        void Graph::setId(Node *n ,int x)
        {
            n-&gt;id = x; 
        }
        void Graph::setVisited(Node *n, bool v)
        {
            n-&gt;visited = v; 
        }

        //Elem Mutator
        void Graph::seteId(Elem *e, int x)
        {
            e-&gt;id = x;
        }

        //Elem Accessor
        int Graph::geteId(Elem *e)
        {
            return e-&gt;id; 
        }

        //Accessors
        int Graph::getId(Node *n)
        {
            return n-&gt; id; 
        }
        bool Graph::getVisited(Node *n)
        {
            return n-&gt;visited; 
        }


    /*
        //This is a graph with a very smart struct

        //This is the main node that makes up the graph. 
        struct Node {
            int id; //int id
            Node *north;    //north path node
            Node *south;    //south path node
            Node *east;     //east path node
            Node *west;     //went path node
            bool visited;   // visited bool 
        };

        //this struct holds the path that is found. 
        struct Elem {
            int id;         //The id of the node
            string last;    //the door that it passed through
            Elem* back;     //back one path         
            Elem* next;     //forward one path 
        };

        Node* Start;

        Node ** initArr;

        Elem* head;
        Elem* tail; 
        */

//outputs using named operation
ostream &amp; operator &lt;&lt; (ostream &amp;s, const Graph &amp; v)
{
    v.output(s);
    return s; 
}
</code></pre>

<p>The error is occurring on the find function.</p>
