Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8724445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:49:59+00:00 2026-06-13T07:49:59+00:00

I wrote a class inherited from wxDialog. I’m currently on Ubuntu 12.04, using Code::Blocks

  • 0

I wrote a class inherited from wxDialog. I’m currently on Ubuntu 12.04, using Code::Blocks with gcc 4.6. My application works fine until I include this class in the project: either the debug and release configuration give the same error. Here’s the code:

Header file

#ifndef EBCDIALOG_H
#define EBCDIALOG_H

#include <wx/dialog.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/button.h>

class EBCDialog : public wxDialog
{
    public:

        EBCDialog(wxWindow* parent, wxWindowID id, const wxString& title );
        ~EBCDialog();

        void OnOK(wxCommandEvent& event);
    private:

       DECLARE_CLASS(EBCDialog)
        DECLARE_EVENT_TABLE()
};

#endif //EBCDIALOG_H

Cpp file:

#include "EBCDialog.h"

EBCDialog::EBCDialog(wxWindow* parent, wxWindowID id, const wxString& title ) : wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
    wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
    // Create text ctrl with minimal size 100x60
    topSizer->Add(new wxTextCtrl(this, wxID_ANY, wxT("test"), wxDefaultPosition, wxSize(100,60)),
        1,  // make vertically stretchable
        wxEXPAND|   // make horizontally stretchable
        wxALL,      // and make border all around
        10);        // set border width to 10

    wxBoxSizer* buttonSizer = new wxBoxSizer( wxHORIZONTAL );
    buttonSizer->Add(new wxButton(this, wxID_OK, _T("OK")),
        0,  // make horizontally unstretchable
        wxALL,  // make border all around: implicit top alignment
        10);   // set border width to 10

    buttonSizer->Add(new wxButton(this, wxID_CANCEL, _T("Cancel")),
        0,  // make horizontally unstretchable
        wxALL,  // make border all around (implicit top alignment)
        10);   // set border width to 10

    topSizer->Add(buttonSizer,
    0,  // make vertically unstretchable
    wxALIGN_CENTER ); // no border and centre horizontally

    SetSizer( topSizer ); // use the sizer for layout
    topSizer->Fit( this );

    // fit the dialog to the contents
    topSizer->SetSizeHints( this ); // set hints to honor min size
}

EBCDialog::~EBCDialog()
{

}

void EBCDialog::OnOK(wxCommandEvent& event)
{

}

BEGIN_EVENT_TABLE(EBCDialog, wxDialog)
    EVT_BUTTON(wxID_OK, EBCDialog::OnOK)
END_EVENT_TABLE()

Here’s Code::Blocks log:

g++ -Wall -I/usr/lib/i386-linux-gnu/wx/include/gtk2-unicode-debug-2.8
-I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_WXDEBUG_ -D_WXGTK_ -pthread -O2 -I”/home/angelo/CodeBlocks/Event Bus Configurer/include” -I”/home/angelo/CodeBlocks/Event Bus Configurer/bitmaps” -c “/home/angelo/CodeBlocks/Event Bus Configurer/src/EBCDialog.cpp” -o
obj/src/EBCDialog.o g++ -o “bin/Event Bus Configurer” obj/src/EBCApp.o
obj/src/EBCDialog.o obj/src/EBCFrame.o obj/src/EBCList.o
obj/src/HandlerFile.o -L/usr/lib/i386-linux-gnu -pthread
-Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/i386-linux-gnu -lwx_gtk2ud_richtext-2.8 -lwx_gtk2ud_aui-2.8 -lwx_gtk2ud_xrc-2.8 -lwx_gtk2ud_qa-2.8 -lwx_gtk2ud_html-2.8 -lwx_gtk2ud_adv-2.8 -lwx_gtk2ud_core-2.8 -lwx_baseud_xml-2.8 -lwx_baseud_net-2.8 -lwx_baseud-2.8 -s obj/src/EBCDialog.o:(.rodata._ZTV9EBCDialog[vtable for EBCDialog]+0x8): undefined reference to `EBCDialog::GetClassInfo()
const’ collect2: ld returned 1 exit status Process terminated with
status 1 (0 minutes, 2 seconds) 1 errors, 0 warnings

Any help is appreciated, thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:50:01+00:00Added an answer on June 13, 2026 at 7:50 am

    remove DECLARE_CLASS(EBCDialog) from your code, the base class wxDialog already does that for you.

    From the documentation:

    wxWidgets uses its own RTTI ("run-time type identification") system which predates the current standard C++ RTTI and so is kept for backwards compatibility reasons but also because it allows some things which the standard RTTI doesn’t directly support (such as creating a class from its name).

    The standard C++ RTTI can be used in the user code without any problems and in general you shouldn’t need to use the functions and the macros in this section unless you are thinking of modifying or adding any wxWidgets classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so i have this code i wrote: class Connection { public static StreamWriter
I am creating my DataGridViewEx class, inherited from DataGridView. I want to create a
As we know in C++ we have class iostream, which is inherited from istream(basic_istream)
I have created an inherited class StorageMedium from a base I called DataTypes. StorageMedium
I am using django-registration app. and have following code in forms.py from django.contrib.auth.forms import
How can I access the R class from classes that were not inherited from
I am trying to write this code where there are 2 classes inherited from
I am trying to write class that inherits from FMX TStyledControl. When style is
Here is a related manager I wrote: class PortfolioItemManager(models.Manager): use_for_related_fields = True def extended(self):
I wrote a class that implements the IGroupPolicyObject Interface in COM. one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.