Return Error -11 when running program

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Return Error -11 when running program

Post by DavidHart »

I apologize for the delay on this
No problem.

But you are creating a OmniFEMMainFrame object. You didn't paste the class definition; maybe it does lots of other things, one of which is the cause of the problem. What happens if you create a MyFrame as in the wx 'minimal' sample (is that what you mean by the "hello world example"?)

In any case, what you pasted isn't complete and compilable, so I can't test it here.
philm
Experienced Solver
Experienced Solver
Posts: 88
Joined: Fri Dec 18, 2015 4:46 am

Re: Return Error -11 when running program

Post by philm »

DavidHart wrote:
I apologize for the delay on this
No problem.

But you are creating a OmniFEMMainFrame object. You didn't paste the class definition; maybe it does lots of other things, one of which is the cause of the problem. What happens if you create a MyFrame as in the wx 'minimal' sample (is that what you mean by the "hello world example"?)

In any case, what you pasted isn't complete and compilable, so I can't test it here.
The OmniFEmMainFrame inherits from the wxFrame class. Which is what the example is doing with MyFrame:

Code: Select all

bool MyApp::OnInit()
{
    MyFrame *frame = new MyFrame();
    frame->Show( true );
    return true;
}
MyFrame::MyFrame()
        : wxFrame(NULL, wxID_ANY, "Hello World")
{
    wxMenu *menuFile = new wxMenu;
    menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
                     "Help string shown in status bar for this menu item");
    menuFile->AppendSeparator();
    menuFile->Append(wxID_EXIT);
    wxMenu *menuHelp = new wxMenu;
    menuHelp->Append(wxID_ABOUT);
    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append( menuFile, "&File" );
    menuBar->Append( menuHelp, "&Help" );
    SetMenuBar( menuBar );
    CreateStatusBar();
    SetStatusText( "Welcome to wxWidgets!" );
    Bind(wxEVT_MENU, &MyFrame::OnHello, this, ID_Hello);
    Bind(wxEVT_MENU, &MyFrame::OnAbout, this, wxID_ABOUT);
    Bind(wxEVT_MENU, &MyFrame::OnExit, this, wxID_EXIT);
}


In fact, when I started writing the code, I started with the Hello World program and built off of that.

At Any rate, I copied/pasted the wxWidgets Hello World example into my workspace and rerouted the wxImplementApp macro to the hello World Class:

Code: Select all

// main.cpp

enum
{
    ID_Hello = 1
};
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
    MyFrame *frame = new MyFrame();
    frame->Show( true );
    return true;
}
MyFrame::MyFrame()
        : wxFrame(NULL, wxID_ANY, "Hello World")
{
    wxMenu *menuFile = new wxMenu;
    menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
                     "Help string shown in status bar for this menu item");
    menuFile->AppendSeparator();
    menuFile->Append(wxID_EXIT);
    wxMenu *menuHelp = new wxMenu;
    menuHelp->Append(wxID_ABOUT);
    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append( menuFile, "&File" );
    menuBar->Append( menuHelp, "&Help" );
    SetMenuBar( menuBar );
    CreateStatusBar();
    SetStatusText( "Welcome to wxWidgets!" );
    Bind(wxEVT_MENU, &MyFrame::OnHello, this, ID_Hello);
    Bind(wxEVT_MENU, &MyFrame::OnAbout, this, wxID_ABOUT);
    Bind(wxEVT_MENU, &MyFrame::OnExit, this, wxID_EXIT);
}
void MyFrame::OnExit(wxCommandEvent& event)
{
    Close( true );
}
void MyFrame::OnAbout(wxCommandEvent& event)
{
    wxMessageBox( "This is a wxWidgets' Hello world sample",
                  "About Hello World", wxOK | wxICON_INFORMATION );
}
void MyFrame::OnHello(wxCommandEvent& event)
{
    wxLogMessage("Hello world from wxWidgets!");
}

Code: Select all

// main.h

class MyApp: public wxApp
{
public:
    virtual bool OnInit();
};
class MyFrame: public wxFrame
{
public:
    MyFrame();
private:
    void OnHello(wxCommandEvent& event);
    void OnExit(wxCommandEvent& event);
    void OnAbout(wxCommandEvent& event);
};

I still get the same error in the output console.

Here is the output in the terminal:

Code: Select all

*** Error in `./Omni-FEM': malloc(): memory corruption (fast): 0x0000000000c1b6b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f4982a7b7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x81d61)[0x7f4982a85d61]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f4982a875d4]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x18)[0x7f498338bb58]
/usr/local/lib/libwx_gtk2u_core-3.1.so.0(_Z22wxInitializeStockListsv+0x30)[0x7f4983fc6210]
/usr/local/lib/libwx_gtk2u_core-3.1.so.0(_ZN9wxAppBase10InitializeERiPPw+0x3e)[0x7f4983f4f09e]
/usr/local/lib/libwx_gtk2u_core-3.1.so.0(_ZN5wxApp10InitializeERiPPw+0x54)[0x7f4983e6cc5e]
/usr/local/lib/libwx_baseu-3.1.so.0(_Z12wxEntryStartRiPPw+0xed)[0x7f49837e98b4]
/usr/local/lib/libwx_baseu-3.1.so.0(_Z12wxInitializeRiPPw+0x69)[0x7f49837e9d7b]
/usr/local/lib/libwx_baseu-3.1.so.0(+0x165ff9)[0x7f49837e9ff9]
/usr/local/lib/libwx_baseu-3.1.so.0(_Z7wxEntryRiPPw+0x37)[0x7f49837e9b75]
/usr/local/lib/libwx_baseu-3.1.so.0(_Z7wxEntryRiPPc+0x3a)[0x7f49837e9ccb]
./Omni-FEM[0x4706a8]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f4982a24830]
./Omni-FEM[0x418599]
======= Memory map: ========
00400000-004da000 r-xp 00000000 08:11 11148385                           /home/phillip/GitHub/Omni-FEM/Debug/Omni-FEM
006d9000-006da000 r--p 000d9000 08:11 11148385                           /home/phillip/GitHub/Omni-FEM/Debug/Omni-FEM
006da000-006dc000 rw-p 000da000 08:11 11148385                           /home/phillip/GitHub/Omni-FEM/Debug/Omni-FEM
006dc000-006ea000 rw-p 00000000 00:00 0 
00bbb000-00c1e000 rw-p 00000000 00:00 0                                  [heap]
7f4974000000-7f4974021000 rw-p 00000000 00:00 0 
7f4974021000-7f4978000000 ---p 00000000 00:00 0 
7f497a4f4000-7f497a4f6000 r-xp 00000000 08:11 18485230                   /usr/lib/x86_64-linux-gnu/gconv/UTF-32.so
7f497a4f6000-7f497a6f5000 ---p 00002000 08:11 18485230                   /usr/lib/x86_64-linux-gnu/gconv/UTF-32.so
7f497a6f5000-7f497a6f6000 r--p 00001000 08:11 18485230                   /usr/lib/x86_64-linux-gnu/gconv/UTF-32.so
7f497a6f6000-7f497a6f7000 rw-p 00002000 08:11 18485230                   /usr/lib/x86_64-linux-gnu/gconv/UTF-32.so
7f497a6fc000-7f497a9d4000 r--p 00000000 08:11 18095314                   /usr/lib/locale/locale-archive
7f497a9d4000-7f497a9f7000 r-xp 00000000 08:11 18088863                   /usr/lib/x86_64-linux-gnu/libgraphite2.so.3.0.1
7f497a9f7000-7f497abf6000 ---p 00023000 08:11 18088863                   /usr/lib/x86_64-linux-gnu/libgraphite2.so.3.0.1
7f497abf6000-7f497abf8000 r--p 00022000 08:11 18088863                   /usr/lib/x86_64-linux-gnu/libgraphite2.so.3.0.1
7f497abf8000-7f497abf9000 rw-p 00024000 08:11 18088863                   /usr/lib/x86_64-linux-gnu/libgraphite2.so.3.0.1
7f497abfc000-7f497ac02000 r-xp 00000000 08:11 18089912                   /usr/lib/x86_64-linux-gnu/libdatrie.so.1.3.3
7f497ac02000-7f497ae02000 ---p 00006000 08:11 18089912                   /usr/lib/x86_64-linux-gnu/libdatrie.so.1.3.3
7f497ae02000-7f497ae03000 r--p 00006000 08:11 18089912                   /usr/lib/x86_64-linux-gnu/libdatrie.so.1.3.3
7f497ae03000-7f497ae04000 rw-p 00007000 08:11 18089912                   /usr/lib/x86_64-linux-gnu/libdatrie.so.1.3.3
7f497ae04000-7f497ae2a000 r-xp 00000000 08:11 5374016                    /lib/x86_64-linux-gnu/libexpat.so.1.6.0
7f497ae2a000-7f497b02a000 ---p 00026000 08:11 5374016                    /lib/x86_64-linux-gnu/libexpat.so.1.6.0
7f497b02a000-7f497b02c000 r--p 00026000 08:11 5374016                    /lib/x86_64-linux-gnu/libexpat.so.1.6.0
7f497b02c000-7f497b02d000 rw-p 00028000 08:11 5374016                    /lib/x86_64-linux-gnu/libexpat.so.1.6.0
7f497b034000-7f497b090000 r-xp 00000000 08:11 18094888                   /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.10000.1
7f497b090000-7f497b290000 ---p 0005c000 08:11 18094888                   /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.10000.1
7f497b290000-7f497b291000 r--p 0005c000 08:11 18094888                   /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.10000.1
7f497b291000-7f497b292000 rw-p 0005d000 08:11 18094888                   /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.10000.1
7f497b294000-7f497b2ab000 r-xp 00000000 08:11 5375013                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7f497b2ab000-7f497b4ab000 ---p 00017000 08:11 5375013                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7f497b4ab000-7f497b4ac000 r--p 00017000 08:11 5375013                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7f497b4ac000-7f497b4ad000 rw-p 00018000 08:11 5375013                    /lib/x86_64-linux-gnu/libresolv-2.23.so
7f497b4ad000-7f497b4af000 rw-p 00000000 00:00 0 
7f497b4b4000-7f497b4d3000 r-xp 00000000 08:11 5374935                    /lib/x86_64-linux-gnu/libselinux.so.1
7f497b4d3000-7f497b6d2000 ---p 0001f000 08:11 5374935                    /lib/x86_64-linux-gnu/libselinux.so.1
7f497b6d2000-7f497b6d3000 r--p 0001e000 08:11 5374935                    /lib/x86_64-linux-gnu/libselinux.so.1
7f497b6d3000-7f497b6d4000 rw-p 0001f000 08:11 5374935                    /lib/x86_64-linux-gnu/libselinux.so.1
7f497b6d4000-7f497b6d6000 rw-p 00000000 00:00 0 
7f497b6dc000-7f497b6e0000 r-xp 00000000 08:11 5374969                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f497b6e0000-7f497b8df000 ---p 00004000 08:11 5374969                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f497b8df000-7f497b8e0000 r--p 00003000 08:11 5374969                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f497b8e0000-7f497b8e1000 rw-p 00004000 08:11 5374969                    /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f497b8e4000-7f497b8fa000 r-xp 00000000 08:11 18089804                   /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f497b8fa000-7f497baf9000 ---p 00016000 08:11 18089804                   /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f497baf9000-7f497bafa000 r--p 00015000 08:11 18089804                   /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f497bafa000-7f497bafb000 rw-p 00016000 08:11 18089804                   /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f497bafb000-7f497bafe000 rw-p 00000000 00:00 0 
7f497bb04000-7f497bb0b000 r-xp 00000000 08:11 5374996                    /lib/x86_64-linux-gnu/librt-2.23.so
7f497bb0b000-7f497bd0a000 ---p 00007000 08:11 5374996                    /lib/x86_64-linux-gnu/librt-2.23.so
7f497bd0a000-7f497bd0b000 r--p 00006000 08:11 5374996                    /lib/x86_64-linux-gnu/librt-2.23.so
7f497bd0b000-7f497bd0c000 rw-p 00007000 08:11 5374996                    /lib/x86_64-linux-gnu/librt-2.23.so
7f497bd0c000-7f497bd14000 r-xp 00000000 08:11 18089052                   /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f497bd14000-7f497bf14000 ---p 00008000 08:11 18089052                   /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f497bf14000-7f497bf15000 r--p 00008000 08:11 18089052                   /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f497bf15000-7f497bf16000 rw-p 00009000 08:11 18089052                   /usr/lib/x86_64-linux-gnu/libxcb-render.so.0.0.0
7f497bf1c000-7f497bf1e000 r-xp 00000000 08:11 18089091                   /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f497bf1e000-7f497c11e000 ---p 00002000 08:11 18089091                   /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f497c11e000-7f497c11f000 r--p 00002000 08:11 18089091                   /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f497c11f000-7f497c120000 rw-p 00003000 08:11 18089091                   /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
7f497c124000-7f497c1c3000 r-xp 00000000 08:11 18088127                   /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.33.6
7f497c1c3000-7f497c3c3000 ---p 0009f000 08:11 18088127                   /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.33.6
7f497c3c3000-7f497c3cb000 r--p 0009f000 08:11 18088127                   /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.33.6
7f497c3cb000-7f497c3cc000 rw-p 000a7000 08:11 18088127                   /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.33.6
7f497c3cc000-7f497c470000 r-xp 00000000 08:11 18089298                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f497c470000-7f497c66f000 ---p 000a4000 08:11 18089298                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f497c66f000-7f497c675000 r--p 000a3000 08:11 18089298                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f497c675000-7f497c676000 rw-p 000a9000 08:11 18089298                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f497c67c000-7f497c6ea000 r-xp 00000000 08:11 5374022                    /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f497c6ea000-7f497c8ea000 ---p 0006e000 08:11 5374022                    /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f497c8ea000-7f497c8eb000 r--p 0006e000 08:11 5374022                    /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f497c8eb000-7f497c8ec000 rw-p 0006f000 08:11 5374022                    /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f497c8ec000-7f497c8f4000 r-xp 00000000 08:11 18089914                   /usr/lib/x86_64-linux-gnu/libthai.so.0.2.4
7f497c8f4000-7f497caf3000 ---p 00008000 08:11 18089914                   /usr/lib/x86_64-linux-gnu/libthai.so.0.2.4
7f497caf3000-7f497caf4000 r--p 00007000 08:11 18089914                   /usr/lib/x86_64-linux-gnu/libthai.so.0.2.4
7f497caf4000-7f497caf5000 rw-p 00008000 08:11 18089914                   /usr/lib/x86_64-linux-gnu/libthai.so.0.2.4
7f497cafc000-7f497cb03000 r-xp 00000000 08:11 18088598                   /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
7f497cb03000-7f497cd02000 ---p 00007000 08:11 18088598                   /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
7f497cd02000-7f497cd03000 r--p 00006000 08:11 18088598                   /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
7f497cd03000-7f497cd04000 rw-p 00007000 08:11 18088598                   /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
7f497cd04000-7f497cd06000 r-xp 00000000 08:11 18095615                   /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f497cd06000-7f497cf05000 ---p 00002000 08:11 18095615                   /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f497cf05000-7f497cf06000 r--p 00001000 08:11 18095615                   /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f497cf06000-7f497cf07000 rw-p 00002000 08:11 18095615                   /usr/lib/x86_64-linux-gnu/libXcomposite.so.1.0.0
7f497cf0c000-7f497cf15000 r-xp 00000000 08:11 18095617                   /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f497cf15000-7f497d114000 ---p 00009000 08:11 18095617                   /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f497d114000-7f497d115000 r--p 00008000 08:11 18095617                   /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f497d115000-7f497d116000 rw-p 00009000 08:11 18095617                   /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f497d11c000-7f497d126000 r-xp 00000000 08:11 18089938                   /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f497d126000-7f497d325000 ---p 0000a000 08:11 18089938                   /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f497d325000-7f497d326000 r--p 00009000 08:11 18089938                   /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f497d326000-7f497d327000 rw-p 0000a000 08:11 18089938                   /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f497d32c000-7f497d33b000 r-xp 00000000 08:11 18092524                   /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7f497d33b000-7f497d53a000 ---p 0000f000 08:11 18092524                   /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7f497d53a000-7f497d53b000 r--p 0000e000 08:11 18092524                   /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7f497d53b000-7f497d53c000 rw-p 0000f000 08:11 18092524                   /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7f497d53c000-7f497d53e000 r-xp 00000000 08:11 18095633                   /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f497d53e000-7f497d73d000 ---p 00002000 08:11 18095633                   /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f497d73d000-7f497d73e000 r--p 00001000 08:11 18095633                   /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f497d73e000-7f497d73f000 rw-p 00002000 08:11 18095633                   /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7f497d744000-7f497d74d000 r-xp 00000000 08:11 18089895                   /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f497d74d000-7f497d94c000 ---p 00009000 08:11 18089895                   /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f497d94c000-7f497d94d000 r--p 00008000 08:11 18089895                   /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f497d94d000-7f497d94e000 rw-p 00009000 08:11 18089895                   /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f497d954000-7f497d991000 r-xp 00000000 08:11 18088610                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.9.0
7f497d991000-7f497db90000 ---p 0003d000 08:11 18088610                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.9.0
7f497db90000-7f497db92000 r--p 0003c000 08:11 18088610                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.9.0
7f497db92000-7f497db97000 rw-p 0003e000 08:11 18088610                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.9.0
7f497db9c000-7f497dbb0000 r-xp 00000000 08:11 18091820                   /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3800.1
7f497dbb0000-7f497ddb0000 ---p 00014000 08:11 18091820                   /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3800.1
7f497ddb0000-7f497ddb1000 r--p 00014000 08:11 18091820                   /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3800.1
7f497ddb1000-7f497ddb2000 rw-p 00015000 08:11 18091820                   /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0.3800.1
7f497ddb4000-7f497df34000 r-xp 00000000 08:11 18091600                   /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
7f497df34000-7f497e134000 ---p 00180000 08:11 18091600                   /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
7f497e134000-7f497e138000 r--p 00180000 08:11 18091600                   /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
7f497e138000-7f497e13a000 rw-p 00184000 08:11 18091600                   /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.2
7f497e13a000-7f497e13c000 rw-p 00000000 00:00 0 
7f497e13c000-7f497e15e000 r-xp 00000000 08:11 18094872                   /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0.21809.1
7f497e15e000-7f497e35d000 ---p 00022000 08:11 18094872                   /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0.21809.1
7f497e35d000-7f497e360000 r--p 00021000 08:11 18094872                   /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0.21809.1
7f497e360000-7f497e361000 rw-p 00024000 08:11 18094872                   /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0.21809.1
7f497e364000-7f497e367000 r-xp 00000000 08:11 18091597                   /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.2
7f497e367000-7f497e566000 ---p 00003000 08:11 18091597                   /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.2
7f497e566000-7f497e567000 r--p 00002000 08:11 18091597                   /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.2
7f497e567000-7f497e568000 rw-p 00003000 08:11 18091597                   /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.2
7f497e56c000-7f497e571000 r-xp 00000000 08:11 18089184                   /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f497e571000-7f497e770000 ---p 00005000 08:11 18089184                   /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f497e770000-7f497e771000 r--p 00004000 08:11 18089184                   /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f497e771000-7f497e772000 rw-p 00005000 08:11 18089184                   /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f497e774000-7f497e776000 r-xp 00000000 08:11 18095610                   /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f497e776000-7f497e976000 ---p 00002000 08:11 18095610                   /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f497e976000-7f497e977000 r--p 00002000 08:11 18095610                   /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f497e977000-7f497e978000 rw-p 00003000 08:11 18095610                   /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f497e97c000-7f497e97f000 r-xp 00000000 08:11 5375000                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f497e97f000-7f497eb7e000 ---p 00003000 08:11 5375000                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f497eb7e000-7f497eb7f000 r--p 00002000 08:11 5375000                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f497eb7f000-7f497eb80000 rw-p 00003000 08:11 5375000                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f497eb84000-7f497eb9d000 r-xp 00000000 08:11 5374947                    /lib/x86_64-linux-gnu/libz.so.1.2.8
7f497eb9d000-7f497ed9c000 ---p 00019000 08:11 5374947                    /lib/x86_64-linux-gnu/libz.so.1.2.8
7f497ed9c000-7f497ed9d000 r--p 00018000 08:11 5374947                    /lib/x86_64-linux-gnu/libz.so.1.2.8
7f497ed9d000-7f497ed9e000 rw-p 00019000 08:11 5374947                    /lib/x86_64-linux-gnu/libz.so.1.2.8
7f497eda4000-7f497edc8000 r-xp 00000000 08:11 5375052                    /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f497edc8000-7f497efc7000 ---p 00024000 08:11 5375052                    /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f497efc7000-7f497efc8000 r--p 00023000 08:11 5375052                    /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f497efc8000-7f497efc9000 rw-p 00024000 08:11 5375052                    /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f497efcc000-7f497efd3000 r-xp 00000000 08:11 18089806                   /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f497efd3000-7f497f1d2000 ---p 00007000 08:11 18089806                   /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f497f1d2000-7f497f1d3000 r--p 00006000 08:11 18089806                   /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f497f1d3000-7f497f1d4000 rw-p 00007000 08:11 18089806                   /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f497f1d4000-7f497f2e2000 r-xp 00000000 08:11 18094874                   /usr/lib/x86_64-linux-gnu/libcairo.so.2.11400.6
7f497f2e2000-7f497f4e2000 ---p 0010e000 08:11 18094874                   /usr/lib/x86_64-linux-gnu/libcairo.so.2.11400.6
7f497f4e2000-7f497f4e5000 r--p 0010e000 08:11 18094874                   /usr/lib/x86_64-linux-gnu/libcairo.so.2.11400.6
7f497f4e5000-7f497f4e6000 rw-p 00111000 08:11 18094874                   /usr/lib/x86_64-linux-gnu/libcairo.so.2.11400.6
7f497f4e6000-7f497f4e8000 rw-p 00000000 00:00 0 
7f497f4ec000-7f497f4f8000 r-xp 00000000 08:11 18094884                   /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0.3800.1
7f497f4f8000-7f497f6f7000 ---p 0000c000 08:11 18094884                   /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0.3800.1Aborted (core dumped)

DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Return Error -11 when running program

Post by DavidHart »

So you're using the sample code from http://docs.wxwidgets.org/trunk/overvie ... world.html rather than samples/minimal. I just built and tested that in a 16.04 virtualbox guest. It runs fine. Now you need to do the same thing: instead of (ab)using your CodeLite workspace, open a terminal in some suitable directory, touch HelloWorld.cpp, open it in an editor, and paste the sample code from the website. Then do:
g++ -g HelloWorld.cpp $(wx-config --cxxflags --libs) -o hello
and run it:
./hello
If that gives you the same problem then there's a problem with either your ubuntu or your wx installation.

I expect it will work fine, in which case change the code in HelloWorld.cpp to the code you just posted here. Build it in the same way. If that runs OK, you must have a problem with your CodeLite project settings; in which case, check very carefully that you don't have anything hardwired to the 14.04 box.
If you can't see anything wrong, please post your failing project settings.
philm
Experienced Solver
Experienced Solver
Posts: 88
Joined: Fri Dec 18, 2015 4:46 am

Re: Return Error -11 when running program

Post by philm »

DavidHart wrote:So you're using the sample code from http://docs.wxwidgets.org/trunk/overvie ... world.html rather than samples/minimal. I just built and tested that in a 16.04 virtualbox guest. It runs fine. Now you need to do the same thing: instead of (ab)using your CodeLite workspace, open a terminal in some suitable directory, touch HelloWorld.cpp, open it in an editor, and paste the sample code from the website. Then do:
g++ -g HelloWorld.cpp $(wx-config --cxxflags --libs) -o hello
and run it:
./hello
If that gives you the same problem then there's a problem with either your ubuntu or your wx installation.

I expect it will work fine, in which case change the code in HelloWorld.cpp to the code you just posted here. Build it in the same way. If that runs OK, you must have a problem with your CodeLite project settings; in which case, check very carefully that you don't have anything hardwired to the 14.04 box.
If you can't see anything wrong, please post your failing project settings.

OK, So I ran the hello world program perfectly fine. I copied and pasted the code in a different file and in the terminal, I ran the g++ command in terminal, everything was fine.

I then ran this code in a seperate file:

Code: Select all

#include <wx/wx.h>
#include <wx/aboutdlg.h>
#include <wx/stdpaths.h>
#include <wx/listbox.h>
#include <wx/sizer.h>


// For documenting code, see: https://www.stack.nl/~dimitri/doxygen/manual/docblocks.html

class OmniFEMApp : public wxApp
{
	private:
	
		wxSize minSize = wxSize(450, 340);
	
    public:
        virtual bool OnInit();
};






/*! \class OmniFEMMainFrame
 *  \brief The main class for everything
 * 
 *  This class is also the presentation layer of the main frame
 */
class OmniFEMMainFrame : public wxFrame
{
public:
    OmniFEMMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size);
private:
	
	/************
	* Variables *
	*************/
	
	//! Stores the client size of the main window in the x direction
	int clientSizeWidth;
	
	//! Stores the client size of the main window in the y direction
	int clientSizeLength;
	
	//! The menu bar for the main window
	wxMenuBar *menuBar = new wxMenuBar;
	
	wxBoxSizer *groupOneSizer = new wxBoxSizer(wxHORIZONTAL);
	wxBoxSizer *vertBoxSizer = new wxBoxSizer(wxVERTICAL);
	
	//! This would be the file menu in the menu bar
    wxMenu *menuFile = new wxMenu;
	
	//! This would be the edit menu in the menu bar
    wxMenu *menuEdit = new wxMenu;
	
	//! This would be the view menu in the menu bar
    wxMenu *menuView = new wxMenu;
	
	//! This would be the problem menu in the menu bar
    wxMenu *menuProblem = new wxMenu;
	
    //! The Grid menu in the menu bar
    wxMenu *menuGrid = new wxMenu;
    
    //! The properties menu in the menu bar
    wxMenu *menuProperties = new wxMenu;
    
    //! This would be the mesh menu in the menu bar
    wxMenu *menuMesh = new wxMenu;
    
    //! This is the menu entry for hte analsis
    wxMenu *analysisMenu = new wxMenu;
    
	//! This would be the help menu in the menu ba#include <wx/wx.h>

    wxMenu *menuHelp = new wxMenu;
	
	//! This is the object for the toolbar of the main window
	wxToolBar *mainFrameToolBar = new wxToolBar();
};





bool OmniFEMApp::OnInit()
{
   OmniFEMMainFrame *frame = new OmniFEMMainFrame("Omni-FEM", wxPoint(50, 50), minSize);
   frame->Show(true);
   return true; 
}

/****************************
 * Function Implementations *
 ****************************/
 
OmniFEMMainFrame::OmniFEMMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size) : wxFrame(NULL, wxID_ANY, title, pos, size)
{
	
    /* This creates the main menu Bar at the top */
    menuBar->Append(menuFile, "&File");
    menuBar->Append(menuEdit, "&Edit");
    menuBar->Append(menuView, "&View");
    menuBar->Append(menuGrid, "&Grid");
    menuBar->Append(menuProperties, "&Properties");
    menuBar->Append(menuMesh, "&Mesh");
    menuBar->Append(analysisMenu, "&Analysis");
    menuBar->Append(menuHelp, "&Help");
    
    
    /* Creating the menu listing of File menu */
    menuFile->Append(wxID_ANY, "&New\tCtrl-N");
    menuFile->Append(wxID_ANY, "&Save\tCtrl-S");
    menuFile->Append(wxID_ANY, "&Save As");
	menuFile->Append(wxID_ANY, "&Open");
    menuFile->AppendSeparator();
    menuFile->Append(wxID_EXIT);
    
    /* Creating the menu listinging of the Edit Menu */
    menuEdit->Append(wxID_ANY, "&Undo");
    menuEdit->Append(wxID_ANY, "&Copy");
    menuEdit->Append(wxID_ANY, "&Delete");
    menuEdit->Append(wxID_ANY, "&Move");
    menuEdit->Append(wxID_ANY, "&Scale");
    menuEdit->Append(wxID_ANY, "&Mirror");
    menuEdit->Append(wxID_ANY, "&Create Radius");
    menuEdit->Append(wxID_ANY, "&Create Open Boundary");
    menuEdit->AppendSeparator();
    menuEdit->Append(wxID_ANY, "&Preferences\tCtrl-P");
	
	/* Creting the menu listing of the View Menu */
    menuView->Append(wxID_ANY, "&Zoom In");
    menuView->Append(wxID_ANY, "&Zoom Out");
    menuView->Append(wxID_ANY, "&Zoom Window");
    menuView->AppendSeparator();
    menuView->Append(wxID_ANY, "&Show Block Name");
	menuView->Append(wxID_ANY, "&Show Orphans");
    menuView->AppendSeparator();
    menuView->Append(wxID_ANY, "&Status Bar");
    menuView->Append(wxID_ANY, "&Lua Console");
    
    /* Create hte menu listing for the grid menu option */
    menuGrid->Append(wxID_ANY, "&Display Grid");
    menuGrid->Append(wxID_ANY, "&Snap to Grid");
    menuGrid->Append(wxID_ANY, "&Set Grid Preferences");
    
    /* Create the menu listing for the properties option */
    menuProperties->Append(wxID_ANY, "&Materials\tCtrl-M");
    menuProperties->Append(wxID_ANY, "&Boundary Conditions\tCtrl-B");
    menuProperties->Append(wxID_ANY, "&Nodal Properties");
    menuProperties->Append(wxID_ANY, "&Circuits/Conductors");
    menuProperties->Append(wxID_ANY, "&Exterior Region");
    menuProperties->AppendSeparator();
    menuProperties->Append(wxID_ANY, "&Materials Library\tCtrl-L");
    
    
	/* Create the menu listing for the mesh menu */
	menuMesh->Append(wxID_ANY, "&Create Mesh");
	menuMesh->Append(wxID_ANY, "&Show Mesh");
	menuMesh->Append(wxID_ANY, "&Delete Mesh");
    
    /* Creating the listinf of the Analysis menu */
    analysisMenu->Append(wxID_ANY, "Analyze");
    analysisMenu->Append(wxID_ANY, "View Results");
    
    /* Creates the menu listing of the help menu */
    menuHelp->Append(wxID_ANY, "View Manual");
    menuHelp->AppendSeparator();
    menuHelp->Append(wxID_ANY, "License");
    menuHelp->Append(wxID_ABOUT);
    
    /* Create and display the menu bar */
    SetMenuBar(menuBar);
    CreateStatusBar();
    
    SetStatusText("Omni-FEM Simulator");

	
	
}

wxIMPLEMENT_APP(OmniFEMApp);// This is where int main is located inside of
Everything again ran fine. Both testes were done outside the codelite environment. I am believing that there is something wrong with the codeLite settings.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Return Error -11 when running program

Post by ONEEYEMAN »

Hi,
Please check your CodeLite project settings making sure that they are the same as the options you used to compile wxWidgets.
And as DavidHart said - if you will not see anything, post your CodeLite settings here.

Thank you.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Return Error -11 when running program

Post by DavidHart »

making sure that they are the same as the options you used to compile wxWidgets.
That's (at best) ambiguous. What is required are options that work for this particular computer.

In particular, any paths and filepaths that are specified should be relevant to this computer, not the 14.04 one. Compiler and linker settings should call wx-config, not have its output hard-coded.
philm
Experienced Solver
Experienced Solver
Posts: 88
Joined: Fri Dec 18, 2015 4:46 am

Re: Return Error -11 when running program

Post by philm »

Hello all,

I aplogize for the long delay. At the time, it was optional if I got the build working. I decided to drop it since it was working on one of my computers. Now, I need it to work on both of them. I am still having the issue.

Where we left off, I am able to compile the hello world program manually and I am bale to execute it without any issue. I am also able to run it. Now, when I go into the codeLite IDE, I am able to build without issue. The issue comes when I go to run the same program. Then it is segmentation fault. I am currently playing around with some of the settings to see if the setting could be causing an issue.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Return Error -11 when running program

Post by DavidHart »

Then it is segmentation fault.
Make a debug build of the program if you haven't already done so. Then debug it in CodeLite. When the segfault happens, the backtrace should tell you what went wrong.
philm
Experienced Solver
Experienced Solver
Posts: 88
Joined: Fri Dec 18, 2015 4:46 am

Re: Return Error -11 when running program

Post by philm »

Hello David, Yes I have done that from my previous experiece.

There was a test debug build that only contained the minimal amount of code. The error would always happen within the wx-widgets library when I called wx_IMPLEMENT_APP. Not too sure how to debug this.

However, the hello world program would have no issue whatsoever. So, I decided to look into compiler options inside of wxwidgets. I right clicked on the project and went to settings. Then, under General->Build->Compiler, there is a drop down menu for the different options of the compiler. At first, I was on gnu g++. I changed it to GCC and now I am able to build and run the program sucessfully!

Now, I am going to investigate what is the difference between these 2 options.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Return Error -11 when running program

Post by ONEEYEMAN »

Hi,
If you have 2 compilers installed on the same machine - chances are that you tried to compile with one compiler and link the libraries from another one.

Thank you.
philm
Experienced Solver
Experienced Solver
Posts: 88
Joined: Fri Dec 18, 2015 4:46 am

Re: Return Error -11 when running program

Post by philm »

ONEEYEMAN wrote:Hi,
If you have 2 compilers installed on the same machine - chances are that you tried to compile with one compiler and link the libraries from another one.

Thank you.
But I thought that for GCC, the compiler and linker where in the same file?

In my build settings, for the GCC settings, I have the C++ compiler as:
/usr/bin/g++

and the linker as:
/usr/bin/g++

For gnu g++ settings, for the compiler, I have:
/usr/bin/g+4.9

and the linker I have:
/usr/bin/g++-4.9

I have verified that these files do exist. Could I have a corrupted version of g++? As far as I am aware, I have the correct linker going to the correct compiler.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Return Error -11 when running program

Post by DavidHart »

Have a look in /usr/bin/. You may well have >1 versions of g++ installed. /usr/bin/g++ (and /usr/bin/gcc) are usually symlinks to one of those. In your case it may not be pointing at g++-4.9.
philm
Experienced Solver
Experienced Solver
Posts: 88
Joined: Fri Dec 18, 2015 4:46 am

Re: Return Error -11 when running program

Post by philm »

Ok so after experimenting, I found out that the g++ is symbolic and it points to the g++ v6. I created another build configuration with the exact same settings execpt, I changed the compiler and the link to be g++-6. I am now testing it with g++-4.8.

OK, It didn't quite qork with the g++-4.8 still It turns out that the gcc compiler is also symbolic and it was pointing to the gcc-6. I changed it to gcc-4.8 and it still did not compile. There is something very fishy with gcc v4.8. So far only v6 is able to work with the machine. Is there an incompatibility with ubuntu 16.04 and gcc v4.8?
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Return Error -11 when running program

Post by DavidHart »

BTW in Tuesday's post you said the failing g++ version was 4.9. Today you are talking about 4.8. Was '4.9' a typo?
Is there an incompatibility with ubuntu 16.04 and gcc v4.8?
Very unlikely. And I have an old trusty virtualbox guest that uses gcc 4.8. Its wx-based programs build and run normally.

It's more likely that, when you use the failing version, it is linking to something incompatible. Do you see any missing symbols in the output of:
ldd /full/path/to/the/failing/program

In any case, the important thing is that you now know how to build and run successfully, either inside or outside CodeLite.
Post Reply