struct does not name a type : <p>I'm having a problem with a struct declaration.  Any help would be appreciated. Code below.</p>

<pre><code>    //in 8puzz.h
    #include string
    using namespace std;

    struct state{
    state();
    int cval;
    string board;
    state* parent;
    state* previous;
    state* next;
    };

    state starter;
    state* open;
    state* closed;
    string start;

    //in 8puzz.cpp
    #include "8puzz.h"
    using namespace std;

    state::state(){
    board="";
    cval=0;
    parent=NULL;
    previous=NULL;
    next=NULL;
    };

    //in main.cpp
    #include "8puzz.cpp"
    using namespace std; 

    starter.cval=Heuristic(start); 
    open= &amp;starter;
    closed= &amp;starter;

    //end code
</code></pre>

<p>Heuristic() is a function that takes a string and returns an int.  Will post if needed, but I believe it is irrelevant; replacing it with an int does not change the outcome.</p>

<p>The error I'm getting is "starter does not name a type."  Same for "open" and "closed."  I have seen other questions about this error, but all of those are for a struct inside a class and it seems the solution always has to do with qualifying the class and struct names.  I don't think this can be the problem here since the struct is declared independently.  I have tried many permutations; declaring everything inside 8puzz.cpp, with the constructor, without the constructor, constructor at the beginning of the struct declaration, constructor at the end, constructor defined with the definition, constructor defined separately.  I've included this version because, based on everything I've read, I believe it follows best practices, but every version has given me the same error.  Any help would be great.  Thank you in advance!  </p>
