whats wrong with this function? where did i make mistake? [closed]
I have this function declaration and its defination:
declaration
void laodFromFile(
string const& fileName,
Frames& frames,
ostream& log =std::clog);
defination:
void loadFromFile(
string const& fileName,
Frames& frames,
ostream& log =std::clog
)
{
using std::endl;
using std::ifstream;
string const streamDescription =开发者_如何学Go "text data file " + fileName;
log << "Opening " << streamDescription << " for reading..." << endl;
ifstream stream( fileName.c_str() );
(!stream.fail())
|| throwX( S() << "Error opening " << streamDescription << "." );
loadFrom( stream, frames, streamDescription, log );
}
error:
Error 1 error LNK2019: unresolved external symbol "void __cdecl soundData::laodFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class soundData::Frames &,class std::basic_ostream<char,struct std::char_traits<char> > &)" (?laodFromFile@soundData@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAVFrames@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z) referenced in function "void __cdecl cppMain(int,char const * const * const)" (?cppMain@@YAXHQBQBD@Z) C:\lacture\loading frames\loading frames\main.obj loading frames
what is wrong with that function? any one can guide me... Expecting a good response thanks
It's a spelling mistake LoadFromFile and LaodFromFile...
You've got laodFromFile
somewhere, and loadFromFile
somewhere else. Fix your typos.
精彩评论