Hi,
I"m just trying to get the hang of wxWiidgets. There's a few things I don't understand, and I've had trouble compiling a basic application from scratch.
I'm using wxWidgets 2.8.0. I've got a fair understanding of command-line c++ programming, but never dealt with GUI's before.
I'm getting an error when compiling my project which says:
Basic.cpp:: undefined reference to `vtable for BasicFrame'
Basic.cpp:: undefined reference to `vtable for BasicFrame'
:: === Build finished: 2 errors, 0 warnings ===
Here is Basic.h
#ifndef BASIC_H
#define BASIC_H
class Basic: public wxApp
{
public:
virtual bool OnInit();
};
class BasicFrame: public wxFrame
{
public:
BasicFrame(const wxString & title, int xpos, int ypos, int width, int height);
~BasicFrame();
};
#endif
___________________________________________________________________
and here is Basic.cpp
#include "basic.h"
#include <wx/wx.h>
IMPLEMENT_APP(Basic)
bool Basic::OnInit()
{
BasicFrame *frame = new BasicFrame(_("Sample"), 50,50,450,300);
frame->Show();
SetTopWindow(frame);
return true;
}
BasicFrame::BasicFrame (const wxString & title, int xpos, int ypos, int width, int height)
: wxFrame(NULL, -1, title, wxPoint (xpos,ypos), wxSize (width, height))
{}
____________________________________________________________________________
For the moment I'm just trying to get a wxFrame showing, and then I'll mess around with event handling and controls, etc.
Another thing which I'm unsure about is the use of the _ symbol on this line:
BasicFrame *frame = new BasicFrame(_("Sample"), 50,50,450,300);
What does the _ in _("Sample") do?
I appreciate your time.