Answer the question
In order to leave comments, you need to log in
C++, no default constructor found, what's the problem?
There is a code
class mainWindow : public Fl_Window {
public:
mainWindow(int w, int h, int x, int y,const string& t)
{
Fl_Window(x,y,w,h,t.c_str());
}
~mainWindow();
Fl_Button *start1 = new Fl_Button(180, 140, 40, 20, "Start");
};
Ошибка 1 error C2512: Fl_Window: нет подходящего конструктора по умолчанию
Fl_Window(int x, int y, int w, int h, const char* title = 0);
Fl_Window(int w, int h, const char* title= 0);
Answer the question
In order to leave comments, you need to log in
Fl_Window(x,y,w,h,t.c_str());
Here you create a temporary local object of type Fl_Window. Is this what you need?
If you want to initialize the base class, do it in the initialization list:
mainWindow(int w, int h, int x, int y,const string& t) : Fl_Window(x,y,w,h,t.c_str())
{}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question