I am trying wxWidgets ( 2.8 ) on C::B ( 10.5 ), created a new project, setup every thing as shown by many guides / tutorials. When I try to compile, it gives two warnings
- error : redefinition of wxFrame
- error : redefinition of wxApp
in wxMain.h
class wxFrame : public wxFrame {
//constr
//distor
//few funct
//few static const
//a pointer
};
in wxApp.h
class wxApp : public wxApp {
//OnInit function
};
All the code is auto generated, as I am just starting to learn wxWidgets
Yes I tried that before but there were many more errors, :-[
Now I changed them again
in wxMain.h
class MywxFrame : public wxFrame {
//constr MywxFrame
//distor MywxFrame
//few funct
//few static const
//a pointer
};
in wxMain.cpp
respective changes
in wxApp.h
class MywxApp : public wxApp {
//OnInit function
};
in wxApp.cpp
respective changes
The thing that made it work was changing
BEGIN_EVENT_TABLE(wxFrame, wxFrame){} //error (auto generated code)
to BEGIN_EVENT_TABLE(MywxFrame, wxFrame){} //Correct
which previously I did was BEGIN_EVENT_TABLE(MywxFrame, MywxFrame){} //error
in wxMain.cpp
So all this implies that the auto generated code has error, how do I correct it, so next time I create a new project and don't have to do all this.