Thread: Error: `END_EVENT_TABLE' was not declared in this scope

  1. #1
    Registered User eam's Avatar
    Join Date
    Oct 2003
    Posts
    53

    Error: `END_EVENT_TABLE' was not declared in this scope

    I'm trying to compile the chapter two example from http://users.skynet.be/saw/wxtutorial/wxTutorial.html on Linux...

    Code:
    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:
    Code:
    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?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Looking at other examples, maybe the line should be:

    END_EVENT_TABLE()
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User eam's Avatar
    Join Date
    Oct 2003
    Posts
    53
    Awesome, it works. I've been trying to fix this code for hours... the tutorial had other errors too :/. Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 12:03 PM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Nested loop frustration
    By caroundw5h in forum C Programming
    Replies: 14
    Last Post: 03-15-2004, 08:45 PM