I have a problem when I launch the execution of my program which is however minimal and without error in compilation.
I can't seem to find where the error is. If anyone can help me, I thank them in advance.
My laptop: Asus k73SV Intel® Core ™ i7-2630QM CPU @ 2.00GHz × 8 - 1TB SSD
My environment: Ubuntu 20.04.2 - CodeBlocks 20.03 - wxWidgets 3.0.5 (build: ../configure --with-gtk = 3 - enable-shared --enable-monolithic --enable-unicode).
The build log :
-------------- Clean: debug in pmGenealogy2 (compiler: GNU GCC Compiler)---------------
Cleaned "pmGenealogy2 - debug"
-------------- Build: debug in pmGenealogy2 (compiler: GNU GCC Compiler)---------------
g++ -Wall -std=gnu++17 -g -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -std=c++17 -g -std=c++17 -I/home/patrick/CBProjects/pmGenealogy2/ -c /home/patrick/CBProjects/pmGenealogy2/mainframe.cpp -o debug/obj/mainframe.o
g++ -Wall -std=gnu++17 -g -I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -std=c++17 -g -std=c++17 -I/home/patrick/CBProjects/pmGenealogy2/ -c /home/patrick/CBProjects/pmGenealogy2/myapp.cpp -o debug/obj/myapp.o
g++ -o debug/bin/pmGenealogy2 debug/obj/mainframe.o debug/obj/myapp.o -L/usr/local/lib -pthread -lwx_gtk3u-3.0
Output file is debug/bin/pmGenealogy2 with size 725.13 KB
Process terminated with status 0 (0 minute(s), 4 second(s))
0 error(s), 0 warning(s) (0 minute(s), 4 second(s))
-------------- Run: debug in pmGenealogy2 (compiler: GNU GCC Compiler)---------------
Checking for existence: /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2
Set variable: LD_LIBRARY_PATH=.:/usr/local/lib:
Executing: /home/patrick/CBProjects/pmGenealogy2/debug/bin/pmGenealogy2 (in /home/patrick/CBProjects/pmGenealogy2/.)
Process terminated with status -11 (0 minute(s), 0 second(s))
My sources:
Code: Select all
[b]myapp.cpp:[/b]
#include "myapp.h"
#include "mainframe.h"
wxIMPLEMENT_APP( myApp );
bool myApp::OnInit()
{
if ( ! myApp::OnInit() ) { return false; }
mainFrame * frame = new mainFrame( m_locale, m_lang );
frame->Center();
frame->Show();
return true;
}
[b]myapp.h:[/b]
#ifndef MY_APP_H_INCLUDED
#define MY_APP_H_INCLUDED
#include <wx/wx.h>
class myApp : public wxApp
{
public:
myApp() { m_lang = wxLANGUAGE_UNKNOWN; }
virtual bool OnInit();
private:
wxLocale m_locale; // locale that will be used
wxLanguage m_lang; // language specified by user
};
// implement myApp & wxGetApp()
wxDECLARE_APP( myApp );
#endif // MY_APP_H_INCLUDED
[b]mainframe.cpp:[/b]
#include "mainframe.h"
#include "icons/wxwidgets.xpm"
wxBEGIN_EVENT_TABLE( mainFrame, wxFrame )
EVT_CLOSE( mainFrame::OnClose )
wxEND_EVENT_TABLE()
mainFrame::mainFrame( wxLocale & locale, wxLanguage lang )
: wxFrame( NULL, wxID_ANY, APPLICATION, wxDefaultPosition, wxSize( 800, 400 ),
wxDEFAULT_FRAME_STYLE & ~ ( wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX ) ),
m_locale( locale ), m_lang( lang )
{
this->SetIcon( wxICON( wxwidgets ) );
this->SetMinSize( wxSize( 800, 400 ) );
this->SetMaxSize( wxSize( 800, 400 ) );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
}
Void mainFrame::OnClose( wxCloseEvent & WXUNUSED( event ) )
{
mainFrame::Destroy();
}
[b]mainframe.h:[/b]
#ifndef MY_FRAME_H_INCLUDED
#define MY_FRAME_H_INCLUDED
#include <wx/wx.h>
// =============================================================================
// global constants of the application
#define APPLICATION "pmGenealogy"
#define COPYRIGHT "Copyright © 2021-"
#define DEVELOPER "Patrick MULOT - [email protected]"
#define VERSION "Version 1.0.00"
// =============================================================================
class mainFrame : public wxFrame
{
public:
mainFrame( wxLocale & m_locale, wxLanguage m_lang );
virtual ~mainFrame() {}
void OnClose( wxCloseEvent & WXUNUSED( event ) );
private:
wxLocale & m_locale;
wxLanguage m_lang;
wxDECLARE_EVENT_TABLE();
};
#endif // MY_FRAME_H_INCLUDED