Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "incomplete type is not allowed" error mean?

I am trying to declare a callback routine in C++ as follows:

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.
     */

However, I get the following error:

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

I'm not sure how to correct this. I have other similar callback routines declared in the same header file, and I do not get this error.

Please help! :)

like image 917
Blade3 Avatar asked Feb 08 '10 16:02

Blade3


1 Answers

You cannot use new because it is a keyword. Try to pick a valid identifier for your second argument.

like image 57
anthares Avatar answered Nov 15 '22 07:11

anthares