gpt4 book ai didi

c++ - do_ 未在此范围内声明

转载 作者:行者123 更新时间:2023-11-30 04:40:26 24 4
gpt4 key购买 nike

迷失在这部分代码上。


const struct editor_cmd_type editor_table[] =
{
/* { command function }, */

{ "area", do_aedit },
{ "room", do_redit },
{ "object", do_oedit },
{ "mobile", do_medit },
{ "mpcode", do_mpedit },
{ "hedit", do_hedit },

{ NULL, 0, }
};

我遇到的错误:

olc.c:652: error: âdo_aeditâ was not declared in this scopeolc.c:653: error: âdo_reditâ was not declared in this scopeolc.c:654: error: âdo_oeditâ was not declared in this scopeolc.c:655: error: âdo_meditâ was not declared in this scopeolc.c:656: error: âdo_mpeditâ was not declared in this scopeolc.c:657: error: âdo_heditâ was not declared in this scopemake: *** [olc.o] Error 1

代码中已经有 void do_aeditvoid do_redit 等...我还缺少什么?

最佳答案

你说代码中定义了 void do_aedit 等,但从编译器错误来看,这些似乎在文件 olc.c 中未定义(显示的代码可能在其中)。函数是否在显示的代码之前声明?如果它们在另一个文件中,是否包含在内?

关于c++ - do_ 未在此范围内声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1329934/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com