I'm trying to make a routine that loads up entries from a file (delimited by a newline) into an STL list. However, I'm getting a few errors:
The declaration of 'TheFile' gives the following error:Code:void CDatabase::LoadFile(LPSTR FileToLoad) { ifstream TheFile; TheFile.open(FileToLoad,ifstream::in);
The call to 'TheFile.open()' gives a pretty similar error:c:\Documents and Settings\Ben Forbes\My Documents\Visual Studio Projects\misc2\music\CDatabase.cpp(23): error C2079: 'TheFile' uses undefined class 'std::basic_ifstream<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
[quote]
c:\Documents and Settings\Ben Forbes\My Documents\Visual Studio Projects\misc2\music\CDatabase.cpp(26): error C2027: use of undefined type 'std::basic_ifstream<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
[/code]
I've included 'iostream' and specified 'using namespace std'. Can anyone see something wrong with my code so far?