PDA

View Full Version : Error: `END_EVENT_TABLE' was not declared in this scope



eam
02-12-2005, 06:34 PM
I'm trying to compile the chapter two example from http://users.skynet.be/saw/wxtutorial/wxTutorial.html on Linux...



eric@DataStream:~/code/texteditor$ g++ textframe.cpp texteditorapp.cpp `wx-config --libs` `wx-config --cxxflags` -o texteditor
textframe.cpp:44: `END_EVENT_TABLE' was not declared in this scope
textframe.cpp:44: syntax error before `void'


lines 37-47:


BEGIN_EVENT_TABLE(TextFrame, wxFrame)
EVT_MENU(MENU_FILE_OPEN, TextFrame::OnMenuFileOpen)
EVT_MENU(MENU_FILE_SAVE, TextFrame::OnMenuFileSave)
EVT_MENU(MENU_FILE_QUIT, TextFrame::OnMenuFileQuit)
EVT_MENU(MENU_INFO_ABOUT, TextFrame::OnMenuInfoAbout)
END_EVENT_TABLE

void TextFrame::OnMenuFileOpen(wxCommandEvent &event)
{
wxLogMessage("File Open Menu Selected");
}


This was taken out of the example... Anyone know why it doesn't work?

Hammer
02-12-2005, 06:43 PM
Looking at other examples, maybe the line should be:

END_EVENT_TABLE()

eam
02-12-2005, 06:50 PM
Awesome, it works. I've been trying to fix this code for hours... the tutorial had other errors too :/. Thanks.