Event Table problem(wxWidgets)

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2008
Posts: 111
Reputation: clutchkiller is an unknown quantity at this point 
Solved Threads: 1
clutchkiller's Avatar
clutchkiller clutchkiller is offline Offline
Junior Poster

Event Table problem(wxWidgets)

 
0
  #1
Apr 7th, 2009
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
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!
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 476
Reputation: nucleon has a spectacular aura about nucleon has a spectacular aura about 
Solved Threads: 91
nucleon's Avatar
nucleon nucleon is offline Offline
Posting Pro in Training

Re: Event Table problem(wxWidgets)

 
0
  #2
Apr 8th, 2009
Presumably something needs to be declared as virtual in Utility. Without code, it's hard to say exactly what.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 111
Reputation: clutchkiller is an unknown quantity at this point 
Solved Threads: 1
clutchkiller's Avatar
clutchkiller clutchkiller is offline Offline
Junior Poster

Re: Event Table problem(wxWidgets)

 
0
  #3
Apr 8th, 2009
Here is my Header file:

  1. #ifndef UTILITY_H
  2. #define UTILITY_H
  3.  
  4. #include <wx/wx.h>
  5.  
  6. enum
  7. {
  8. btn_send = 100,
  9. btn_main,
  10. im_box_rec,
  11. im_box_ent,
  12. im_box_con,
  13. im_box_addip,
  14. im_combo
  15. };
  16.  
  17. class Utility : public wxFrame
  18. {
  19. public:
  20. Utility(const wxString &title, const wxPoint &pos, const wxSize &size);
  21.  
  22. private:
  23. DECLARE_EVENT_TABLE();
  24.  
  25. };
  26.  
  27. #endif

And here is my .cpp:

  1. #include "Utility.h"
  2. #include <wx/wx.h>
  3.  
  4. Utility::Utility(const wxString &title, const wxPoint &pos, const wxSize &size) : wxFrame(NULL, -1, title, pos, size)
  5. {
  6. /////////////////////////MENU////////////////////////////////
  7.  
  8.  
  9. wxMenu *util_list = new wxMenu;
  10.  
  11. util_list -> Append(-1, _T("&"));
  12. util_list -> Append(-1, _T("&"));
  13. util_list -> Append(-1, _T("&"));
  14. util_list -> AppendSeparator();
  15. util_list -> Append(-1, _T("&About"));
  16. util_list -> AppendSeparator();
  17. util_list -> Append(-1, _T("E&xit"));
  18.  
  19. wxMenuBar *MENU = new wxMenuBar;
  20.  
  21. MENU -> Append(util_list, _T("&Utilities"));
  22.  
  23. SetMenuBar(MENU);
  24.  
  25. ///////////////////////PANELS/////////////////////////////
  26.  
  27. wxPanel *mainPanel = new wxPanel(this, -1, wxPoint(0,0), wxSize(1000,600), wxBORDER_STATIC);
  28. wxPanel *sideWin = new wxPanel(mainPanel, -1, wxPoint(800,0), wxSize(200,500), wxBORDER_STATIC);
  29.  
  30. wxTextCtrl *imBox_rec = new wxTextCtrl(mainPanel, im_box_rec, _T("Recieve text..."), wxPoint(0, 50), wxSize(400,200));
  31. wxTextCtrl *imBox_ent = new wxTextCtrl(mainPanel, im_box_ent, _T("Enter text..."), wxPoint(0,300), wxSize(400,100));
  32.  
  33. wxComboBox *imCombo = new wxComboBox(mainPanel, im_combo, _T("IP List"), wxPoint(100, 25), wxSize(152, 100));
  34.  
  35. wxButton *saveTran = new wxButton(mainPanel, -1, _T("Save Transcript"), wxPoint(0, 252), wxSize(400, 20));
  36. wxButton *addipButton = new wxButton(mainPanel, im_box_addip, _T("Add IP"), wxPoint(100,0), wxSize(150,25));
  37. wxButton *conButton = new wxButton(mainPanel, im_box_con, _T("Connect to IP"), wxPoint(0,0), wxSize(100,50));
  38. wxButton *mainButton = new wxButton(mainPanel, btn_main, _T("entr"), wxPoint(300,60), wxSize(100,100));
  39. wxButton *sendButton = new wxButton(mainPanel, btn_send, _T("Send"), wxPoint(0,400), wxSize(400,50));
  40.  
  41. wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
  42.  
  43. mainSizer -> Add(imBox_rec, 0, wxCENTER, 0);
  44. mainSizer -> Add(imBox_ent, 0, wxCENTER, 0);
  45. mainSizer -> Add(mainButton, 0, wxCENTER, 0);
  46. mainSizer -> Add(sendButton, 0, wxCENTER, 0);
  47.  
  48. //mainPanel -> SetAutoLayout(true);
  49. //mainPanel -> SetSizer(mainSizer);
  50.  
  51. }
>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!
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 476
Reputation: nucleon has a spectacular aura about nucleon has a spectacular aura about 
Solved Threads: 91
nucleon's Avatar
nucleon nucleon is offline Offline
Posting Pro in Training

Re: Event Table problem(wxWidgets)

 
0
  #4
Apr 8th, 2009
I don't know wxWidgets, so I'm just guessing here. Try making DECLARE_EVENT_TABLE(); public instead of private.

If that doesn't work, try putting this in your code:
  1. BEGIN_EVENT_TABLE(MyFrame, wxFrame)
  2. END_EVENT_TABLE()

Or, if you aren't goint to have any events, remove DECLARE_EVENT_TABLE(); altogether.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,859
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: Event Table problem(wxWidgets)

 
0
  #5
Apr 8th, 2009
Originally Posted by nucleon View Post
Try making DECLARE_EVENT_TABLE(); public instead of private.
Nah, don't do that, it's good as is. However this:

Originally Posted by nucleon View Post
try putting this in your code:
  1. BEGIN_EVENT_TABLE(MyFrame, wxFrame)
  2. END_EVENT_TABLE()

Or, if you aren't goint to have any events, remove DECLARE_EVENT_TABLE(); altogether.
is indeed the answer to your problem.
Last edited by niek_e; Apr 8th, 2009 at 4:32 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 111
Reputation: clutchkiller is an unknown quantity at this point 
Solved Threads: 1
clutchkiller's Avatar
clutchkiller clutchkiller is offline Offline
Junior Poster

Re: Event Table problem(wxWidgets)

 
0
  #6
Apr 8th, 2009
Thanks, that solved it =D
>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!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC