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

  • Home
  • SEARCH
  • 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 3237260
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:43:05+00:00 2026-05-17T17:43:05+00:00

Okay, I have run into a really bizarre problem. I have a wxWidgets program

  • 0

Okay, I have run into a really bizarre problem.

I have a wxWidgets program that has two frames, a main one, and a secondary one.

The main one has a button that calls the second one to open.

I had trouble with calling a derived class from the second wxframe’s class, so I moved the declaration/implementation of the class to before the class for the main frame.

Now I am getting a compile error.

Here is the header file containing the derived wxFrame classes:

/***************************************************************
 * Name:      NUEMain.h
 * Purpose:   Defines Application Frame
 * Author:    Cypher ()
 * Created:   2010-10-02
 * Copyright: Cypher ()
 * License:
 **************************************************************/
#include "System.h"
#ifndef NUEMAIN_H
#define NUEMAIN_H


#include "NUEApp.h"
#include "GUIFrame.h"
#include "System.h"
#include <wx/wx.h>


class NUEAsset : public AssetEd
{
    public:
        NUEAsset(wxFrame *frame){} <-- Error here
        ~NUEAsset(){};

        //Xml object
        XmlO SysX;
    private:
        virtual void OnClose(wxCloseEvent& event);
        virtual void OnQuit(wxCommandEvent& event);
        virtual void OnAbout(wxCommandEvent& event);

        //Open File Event
        virtual void OpenFile( wxCommandEvent& event ){
            wxFileDialog* OpenDialog = new wxFileDialog(
            this, _("Choose a file to open"), wxEmptyString, wxEmptyString,_("XML Files (*.xml)|*.xml"),wxFD_OPEN, wxDefaultPosition);

            // Creates a "open file" dialog with 4 file types
            if (OpenDialog->ShowModal() == wxID_OK) // if the user click "Open" instead of "Cancel"
            {
                //Change Statusbar to display path of opened file
                SetStatusText(OpenDialog->GetPath(),0);

                //Set m_SysListBox contents to names from ssys.xml
                SysX.load(OpenDialog->GetPath());
                Asset assetsys;
                //Start adding names to m_SysListbox
                //Pointer to system
                for(int i = 0; i < SysX.Sys.size(); i++){
                    assetsys = SysX.Sys.at(i);
                    //Get name of system as string
                    //Convert name from string to wxString
                    m_SysListBox->AppendString(assetsys.name);
                }
                // MainEditBox->LoadFile(CurrentDocPath); //Opens that file
            }
                //SetTitle(wxString("Edit - ") <<OpenDialog->GetFilename()); // Set the Title to reflect the file open


        // Clean up after ourselves
        OpenDialog->Destroy();


        }
        //Handle clicking on a system
        virtual void sys_click( wxCommandEvent& event ) {
            //Get the index of the selected item
            int ind;
            ind = m_SysListBox->GetSelection();

            wxString tmp_sys_nam;
            wxString tmp_x;
            wxString tmp_y;

            tmp_sys_nam = SysX.Sys.at(ind).name;
            tmp_x << SysX.Sys.at(ind).x_pos;
            tmp_y << SysX.Sys.at(ind).y_pos;

            //Set the asset name listbox
            m_textPNAME->ChangeValue(tmp_sys_nam);

            //Set the X_pos listbox
            m_textRadius->ChangeValue(tmp_x);

            //Set the Y_pos listbox
            m_textStars->ChangeValue(tmp_y);

        }
};


class NUEFrame: public GUIFrame
{
    public:
        NUEFrame(wxFrame *frame);
        ~NUEFrame();

        //Xml object
        XmlO SysX;
    private:
        virtual void OnClose(wxCloseEvent& event);
        virtual void OnQuit(wxCommandEvent& event);
        virtual void OnAbout(wxCommandEvent& event);

        //Launch Asset Editor
        virtual void launch_asset_ed( wxCommandEvent& event ) {
            NUEAsset* asset_ed_frame = new NUEAsset(0L);
            asset_ed_frame->SetIcon(wxICON(aaaa)); // To Set App Icon
            asset_ed_frame->Show();

        }

        //Open File Event
    /*    virtual void OpenFile( wxCommandEvent& event ){
            wxFileDialog* OpenDialog = new wxFileDialog(
            this, _("Choose a file to open"), wxEmptyString, wxEmptyString,_("XML Files (*.xml)|*.xml"),wxFD_OPEN, wxDefaultPosition);

            // Creates a "open file" dialog with 4 file types
            if (OpenDialog->ShowModal() == wxID_OK) // if the user click "Open" instead of "Cancel"
            {
                //Change Statusbar to display path of opened file
                SetStatusText(OpenDialog->GetPath(),0);

                //Set m_SysListBox contents to names from ssys.xml
                SysX.load(OpenDialog->GetPath());
                Asset assetsys;
                //Start adding names to m_SysListbox
                //Pointer to system
                for(int i = 0; i < SysX.Sys.size(); i++){
                    assetsys = SysX.Sys.at(i);
                    //Get name of system as string
                    //Convert name from string to wxString
                    m_SysListBox->AppendString(assetsys.name);
                }
                // MainEditBox->LoadFile(CurrentDocPath); //Opens that file
            }
                //SetTitle(wxString("Edit - ") <<OpenDialog->GetFilename()); // Set the Title to reflect the file open


        // Clean up after ourselves
        OpenDialog->Destroy();


        } */
        //Handle clicking on a system
     /*   virtual void sys_click( wxCommandEvent& event ) {
            //Get the index of the selected item
            int ind;
            ind = m_SysListBox->GetSelection();

            wxString tmp_sys_nam;
            wxString tmp_x;
            wxString tmp_y;

            tmp_sys_nam = SysX.Sys.at(ind).name;
            tmp_x << SysX.Sys.at(ind).x_pos;
            tmp_y << SysX.Sys.at(ind).y_pos;

            //Set the asset name listbox
            m_textPNAME->ChangeValue(tmp_sys_nam);

            //Set the X_pos listbox
            m_textRadius->ChangeValue(tmp_x);

            //Set the Y_pos listbox
            m_textStars->ChangeValue(tmp_y);

        }*/
};

#endif // NUEMAIN_H

Here is the header from which the classes derive:

///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep  8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#ifndef __GUIFrame__
#define __GUIFrame__

#include <wx/string.h>
#include <wx/button.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/frame.h>
#include <wx/stattext.h>
#include <wx/listbox.h>
#include <wx/textctrl.h>
#include <wx/toolbar.h>
#include <wx/statusbr.h>

///////////////////////////////////////////////////////////////////////////

#define idMenuQuit 1000
#define idMenuAbout 1001

///////////////////////////////////////////////////////////////////////////////
/// Class GUIFrame
///////////////////////////////////////////////////////////////////////////////
class GUIFrame : public wxFrame 
{
 private:

 protected:

  wxButton* m_buttonAsset;
  wxButton* m_buttonShip;


  wxButton* m_buttonTech;
  wxButton* m_buttonOutfit;

  wxMenuBar* m_menubar2;
  wxMenu* m_file;

  // Virtual event handlers, overide them in your derived class
  virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
  virtual void launch_asset_ed( wxCommandEvent& event ) { event.Skip(); }


 public:

  GUIFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("NUE v0.0.1a"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
  ~GUIFrame();

};

///////////////////////////////////////////////////////////////////////////////
/// Class AssetEd
///////////////////////////////////////////////////////////////////////////////
class AssetEd : public wxFrame 
{
 private:

 protected:
  wxMenuBar* mbar;
  wxMenu* fileMenu;
  wxMenu* helpMenu;
  wxStaticText* m_staticTextSysboxlabel;
  wxListBox* m_SysListBox;
  wxStaticText* m_staticParamslabel;
  wxStaticText* m_staticText4;
  wxTextCtrl* m_textPNAME;
  wxStaticText* m_staticText5;
  wxTextCtrl* m_textRadius;
  wxStaticText* m_staticText6;
  wxTextCtrl* m_textStars;
  wxStaticText* m_staticText61;
  wxTextCtrl* m_textInterference;
  wxStaticText* m_staticText611;
  wxStaticText* m_staticText612;
  wxTextCtrl* m_textPosX;
  wxStaticText* m_staticText6121;
  wxTextCtrl* m_textPosY;
  wxStaticText* m_staticLinksLabel;
  wxListBox* m_SysHyperlinkslist;
  wxToolBar* m_toolBar1;
  wxStatusBar* statusBar;

  // Virtual event handlers, overide them in your derived class
  virtual void OpenFILE( wxCommandEvent& event ) { event.Skip(); }
  virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
  virtual void OnAbout( wxCommandEvent& event ) { event.Skip(); }
  virtual void sys_click( wxCommandEvent& event ) { event.Skip(); }


 public:

  AssetEd( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 915,500 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
  ~AssetEd();

};

#endif //__GUIFrame__

This is the error I am getting:
\
NUEMain.h|23|error: no matching function for call to ‘AssetEd::AssetEd()’|

This is an error calling the constructor in the parent class, but I merely copied the way it was done for the original frame, which worked fine.

What is up?

EDIT 1:

Okay, I replaced

NUEAsset(wxFrame *frame){} 

with

NUEAsset(wxFrame *frame): AssetEd(frame){}

and it now fails in the linking stage with the following error:

)]+0x7e)||undefined reference to `vtable for NUEAsset'|

I can’t make heads or tails of this error.

EDIT 2:

Oh, and I keep getting this warning as well, but I have been ignoring it. Could this be related:

||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|

EDIT 3: I think I solved the problem using the information below and some digging.

It turns out that I was defining some events for a frame that no longer had those events.

Changed the defs, and it seems to work now.

  • 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-05-17T17:43:05+00:00Added an answer on May 17, 2026 at 5:43 pm

    AssetEd does not have a default constructor. If you define any constructor of your own, the default constructor will not be implicitly provided.

    The problem is that the base object of a derived class needs to be constructed somehow. If you don’t call a suitable constructor from the initializer list, the default constructor will be used implicitly.

    NUEAsset must simply invoke the constructor of the base class with suitable arguments, e.g

    NUEAsset(wxFrame *frame): Asset(frame) {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay here's the program I have typed up(stdio.h is included also): /* function main
Okay, I have this program and I don't want more than one instance of
Okay, I have ran in to a problem with VB.NET. So all those defenders
Okay I have this RewriteRule which is supposed to redirect any request for the
Okay so I have the following Code which appends a string to another in
Okay so I have a scenario similar to the below code, I have a
I have the following arrays in PHP (okay they are a bit bigger but
Okay, I have a FormView with a couple of child controls in an InsertItemTemplate.
Okay, this is just a crazy idea I have. Stack Overflow looks very structured
Okay this is a real headscratcher. I have an application which calls a web

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.