c++ - "incomplete type is not allowed"错误是什么意思?

标签 c++ compiler-errors keyword

我正尝试在 C++ 中声明一个回调例程,如下所示:

void register_rename (int (*function) (const char *current, const char *new));
    /*------------------------------------------------------------*/
    /* WHEN:  The callback is called once each time a file is received and
     *   accepted.   (Renames the temporary file to its permanent name)
     * WHAT:  Renames a file from the given current name to the specified new name.
     */

但是,我收到以下错误:

line 204: error #70: 
      incomplete type is not allowed
void register_rename (int (*function) (const char *current, const char *new));

我不确定如何纠正这个问题。我在同一个头文件中声明了其他类似的回调例程,但我没有收到此错误。

求助! :)

最佳答案

您不能使用 new,因为它是关键字。尝试为您的第二个参数选择一个有效的标识符。

关于c++ - "incomplete type is not allowed"错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2222939/

相关文章:

vb.net - VB6 类型的等效项

c++ - 模板函数 'know' 如何作为模板参数给出的数组大小?

c++ - 当 STL 容器对象的值不可复制构造时,如何将其附加/复制到另一个对象,例如标准::线程

c++ - 从 std::future<void> 到非标量 std::future<bool> 的转换引发错误

c# - DbContext 没有编译?

iphone - iOS:Sqlite 数据库错误:由于未捕获的异常 'NSInternalInconsistencyException' 而终止应用程序,原因: 'error preparing statement'

c# - 使用 C# "dynamic"关键字实例化

java - 如何通过 Java 实现的关键字停止 Robot Framework 中的测试执行?

C++ Loop 最多运行一次

c++ - 如何从 QTableWidgetItem 中提取显示的文本?