这个功能有什么问题?我哪里弄错了?

时间:2011-05-15 08:15:34

标签: c++

我有这个函数声明及其定义:

声明

void laodFromFile(
      string const& fileName,
      Frames& frames,
      ostream&  log =std::clog);

认定中:

void loadFromFile(
        string const&   fileName,
        Frames&         frames,
        ostream&        log =std::clog
        )
    {
        using std::endl;
        using std::ifstream;

        string const    streamDescription   = "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   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

该功能有什么问题?任何人都可以指导我...... 希望得到一个好的回应,谢谢

2 个答案:

答案 0 :(得分:11)

拼写错误LoadFromFile和LaodFromFile ......

答案 1 :(得分:5)

你某处有laodFromFile,而其他地方有loadFromFile。修复你的错别字。

相关问题