variable 'fstream grabpass' has initializer but incomplete type
<p>I'm getting an error reading from a file using fstream, on line 37 (fstream grabpass("passwords.txt");) but doesn't seem like I'm doing anything wrong.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;string&gt;

using namespace std;

int i,passcount,asterisks;
char replace, value, newchar;
string username,password,storedUsername,storedPassword;

int login(string username, string password)
{
    if (username=="test"/*storedUsername*/)
    {
        if (password==storedPassword)
        cout&lt;&lt;"Win!";
        else
        cout&lt;&lt;"Username correct, password incorrect.";
    }
    else cout&lt;&lt;"Lose. Wrong username and password.";
}

int main()
{
    cout&lt;&lt;"Username: ";
    cin&gt;&gt;username;
    cout&lt;&lt;"Password: ";
    do
    {
    newchar = getch();
    if (newchar==13)break;
    for (passcount&gt;0;asterisks==passcount;asterisks++)cout&lt;&lt;"*";
    password = password + newchar;
    passcount++;
    } while (passcount!=10);

    fstream grabpass("passwords.txt");
    getline(grabpass,storedPassword);
    grabpass.close();
    login(username,password);

    return 0;
}
</code></pre>
