| | |
Event Table problem(wxWidgets)
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
When I declare an event table in a class a.k.a DECLARE_EVENT_TABLE(); then try to compile, i always get this error:
[Linker Error] undefined reference to `vtable for Utility' (utility being my class) What does this mean and how do I fix it? All research on this has turned up dead ends =(. Thanks
[Linker Error] undefined reference to `vtable for Utility' (utility being my class) What does this mean and how do I fix it? All research on this has turned up dead ends =(. Thanks
Last edited by clutchkiller; Apr 7th, 2009 at 11:38 pm.
>That confuses me =(
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Here is my Header file:
And here is my .cpp:
c++ Syntax (Toggle Plain Text)
#ifndef UTILITY_H #define UTILITY_H #include <wx/wx.h> enum { btn_send = 100, btn_main, im_box_rec, im_box_ent, im_box_con, im_box_addip, im_combo }; class Utility : public wxFrame { public: Utility(const wxString &title, const wxPoint &pos, const wxSize &size); private: DECLARE_EVENT_TABLE(); }; #endif
And here is my .cpp:
c++ Syntax (Toggle Plain Text)
#include "Utility.h" #include <wx/wx.h> Utility::Utility(const wxString &title, const wxPoint &pos, const wxSize &size) : wxFrame(NULL, -1, title, pos, size) { /////////////////////////MENU//////////////////////////////// wxMenu *util_list = new wxMenu; util_list -> Append(-1, _T("&")); util_list -> Append(-1, _T("&")); util_list -> Append(-1, _T("&")); util_list -> AppendSeparator(); util_list -> Append(-1, _T("&About")); util_list -> AppendSeparator(); util_list -> Append(-1, _T("E&xit")); wxMenuBar *MENU = new wxMenuBar; MENU -> Append(util_list, _T("&Utilities")); SetMenuBar(MENU); ///////////////////////PANELS///////////////////////////// wxPanel *mainPanel = new wxPanel(this, -1, wxPoint(0,0), wxSize(1000,600), wxBORDER_STATIC); wxPanel *sideWin = new wxPanel(mainPanel, -1, wxPoint(800,0), wxSize(200,500), wxBORDER_STATIC); wxTextCtrl *imBox_rec = new wxTextCtrl(mainPanel, im_box_rec, _T("Recieve text..."), wxPoint(0, 50), wxSize(400,200)); wxTextCtrl *imBox_ent = new wxTextCtrl(mainPanel, im_box_ent, _T("Enter text..."), wxPoint(0,300), wxSize(400,100)); wxComboBox *imCombo = new wxComboBox(mainPanel, im_combo, _T("IP List"), wxPoint(100, 25), wxSize(152, 100)); wxButton *saveTran = new wxButton(mainPanel, -1, _T("Save Transcript"), wxPoint(0, 252), wxSize(400, 20)); wxButton *addipButton = new wxButton(mainPanel, im_box_addip, _T("Add IP"), wxPoint(100,0), wxSize(150,25)); wxButton *conButton = new wxButton(mainPanel, im_box_con, _T("Connect to IP"), wxPoint(0,0), wxSize(100,50)); wxButton *mainButton = new wxButton(mainPanel, btn_main, _T("entr"), wxPoint(300,60), wxSize(100,100)); wxButton *sendButton = new wxButton(mainPanel, btn_send, _T("Send"), wxPoint(0,400), wxSize(400,50)); wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer -> Add(imBox_rec, 0, wxCENTER, 0); mainSizer -> Add(imBox_ent, 0, wxCENTER, 0); mainSizer -> Add(mainButton, 0, wxCENTER, 0); mainSizer -> Add(sendButton, 0, wxCENTER, 0); //mainPanel -> SetAutoLayout(true); //mainPanel -> SetSizer(mainSizer); }
>That confuses me =(
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
Get used to it. Good programmers are in a constant state of confusion.
>Looks like i have some quasi specifics to investigate! Up Up And AWAY!
I don't know wxWidgets, so I'm just guessing here. Try making
If that doesn't work, try putting this in your code:
Or, if you aren't goint to have any events, remove
DECLARE_EVENT_TABLE(); public instead of private.If that doesn't work, try putting this in your code:
C++ Syntax (Toggle Plain Text)
BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE()
Or, if you aren't goint to have any events, remove
DECLARE_EVENT_TABLE(); altogether. Nah, don't do that, it's good as is. However this:
is indeed the answer to your problem.
•
•
•
•
try putting this in your code:
C++ Syntax (Toggle Plain Text)
BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE()
Or, if you aren't goint to have any events, removeDECLARE_EVENT_TABLE();altogether.
Last edited by niek_e; Apr 8th, 2009 at 4:32 am.
![]() |
Other Threads in the C++ Forum
- Previous Thread: simple C++ inheritance program not working.
- Next Thread: Deleting a node from a linked list
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game generator getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project proxy python random read recursion recursive return sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






