在下面的C ++代码中,当我调用lookup_add_anim
时,我得到“在此范围内未声明lookup_add_anim”错误,但该函数已经声明:
void loopup_add_anim(Setting& setting,AnimList& animlist){
bool loop;
loop = setting["loop"];
Setting& frames = setting["frames"];
Anim anim = new Anim(loop);
for(int i=0;i<frames.getLength();i++){
anim.addFrame(frames[i]);
}
animlist.addAnim(anim);
}
void set_anims(Config* plaanims,AnimList& animlist){
const Setting& root = plaanims->getRoot();
try{
loopup_add_anim(root["stand_top"],animlist);
lookup_add_anim(root["aim_up"],animlist);
lookup_add_anim(root["stand_bottom"],animlist);
lookup_add_anim(root["running"],animlist);
lookup_add_anim(root["jumping"],animlist);
}catch(const SettingNotFoundException &nfex){
cerr << "Setting not found at" << nfex.getPath() << endl;
}
}
我不知道发生了什么事。请任何人都可以提供任何指示吗?
答案 0 :(得分:1)
这可能只是你问题中的一个拼写错误,但你正在调用的函数名为lookup_add_anim
,但你声明的函数名为loopup_add_anim
。