I was trying to assigna function to a button with a method I have tried before, that also worked before, but for some reason I am getting this from my compiler now:
error C3867: 'WindowReq::calc_cb': non-standard syntax; use '&' to create a pointer to member
Here is the code:
class WindowReq : public Fl_Window
{
public:
WindowReq(int W, int H, const char* Title);
Fl_Input* InVel;
Fl_Input* InDeg;
Fl_Button* Calc;
private:
void calc_cb(Fl_Widget* o, void* v);
};
WindowReq::WindowReq(int W, int H, const char* Title) : Fl_Window(W, H, Title)
{
begin();
Calc = new Fl_Button((WINSIZE - 150), 50, 100, 30, "Calculate path");
Calc->callback(calc_cb, this);
InVel = new Fl_Input(70, 50, 100, 30, "Velocity:");
InDeg = new Fl_Input(((WINSIZE / 3) + 50), 50, 100, 30, "Angle:");
end();
show();
}
I have no idea what the problem is and any help would be greatly appreciated.
Edit: This is the line causing the error according to VisualStudio:
Calc->callback(calc_cb, this);