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

标签 c++

迷失在这部分代码上。


    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 scope
olc.c:653: error: âdo_reditâ was not declared in this scope
olc.c:654: error: âdo_oeditâ was not declared in this scope
olc.c:655: error: âdo_meditâ was not declared in this scope
olc.c:656: error: âdo_mpeditâ was not declared in this scope
olc.c:657: error: âdo_heditâ was not declared in this scope
make: *** [olc.o] Error 1

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

最佳答案

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

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

相关文章:

c++ - Qt Label::setPixmap 不工作

c++ - WINAPI ReadProcessMemory 总是相同的地址

c++ - 无法使用迭代器更改 vector 元素

c++ - 增量后左值误差

带类的 C++ 指针

c++ - std::set 已经包含成员,即使它不同

c++ - 您能否仅使用一项服务将程序与 D-Bus 消息分开?

c++ - 如何将 C++ 库添加到公共(public) linux/unix 集群上的编译器

c++ - clang sanitizer 会检查未初始化的内存吗?

c++ - 在 IMMDeviceEnumerator 上调用 SAFE_RELEASE 时崩溃