Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error C3646: 'closure' : unknown override specifier

I got the following error:

error C3646: 'closure' : unknown override specifier

The code:

void BaseOperator::mousebutton_cb(EventObject* sender, EventArgs* calldata, void* closure)
{
    xd3D::Operation::Operator::BaseOperator* operator = (xd3D::Operation::Operator::BaseOperator*)closure;
    MouseButtonEventArgs* e = (MouseButtonEventArgs*)calldata;
    if (e->Status == Down)
        operator->OnMouseButtonDown(e);
    else
        operator->OnMouseButtonUp(e);
}

Do you know why I have this error?

like image 951
Spectral Avatar asked Nov 03 '25 19:11

Spectral


1 Answers

operator is a keyword. The sequence operator = tries to declare an assignment operator which in your case would have a pointer parameter type. And your compiler wants to parse the very last closure as a special specifier like override (afaik an extension of MSVC), const or such.

Rename the variable to something else, like myoperator.

like image 168
Johannes Schaub - litb Avatar answered Nov 06 '25 15:11

Johannes Schaub - litb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!