Search code examples
c++wxwidgetscodeblocks

wxsmith segmentation fault error codeblocks


So I am new to wxWidget. I was just trying to run the first default sample code right after creating a new wxSmith project in Code::Blocks. But, as soon as I build and run the program, I get 'jpt.exe has stopped working' error. Then, in Code::Blocks, Process terminated with status -1073741819. In Debug Mode, I get SIGSEGV signal, Segmentation Fault.

I'm using Code::Blocks 12.11, wxWidgets via 'wxPack', Windows 7 64 bit.

#0 6C4B98EB wxEvtHandler::wxEvtHandler() () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxbase28_gcc.dll:??)
#1 6C44164A wxAppConsole::wxAppConsole() () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxbase28_gcc.dll:??)
#2 64292557 wxAppBase::wxAppBase() () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxmsw28_core_gcc.dll:??)
#3 64205F62 wxApp::wxApp() () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxmsw28_core_gcc.dll:??)
#4 0040DB0D jptApp::jptApp(this=0xa4e290) (D:/Programming/Projects/LogicGateSimulator/jpt/jptApp.h:15)
#5 004013A4 wxCreateApp() (D:\Programming\Projects\LogicGateSimulator\jpt\jptApp.cpp:18)
#6 6C4706C3 wxEntryStart(int&, char**) () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxbase28_gcc.dll:??)
#7 6C470812 wxInitialize(int, char**) () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxbase28_gcc.dll:??)
#8 6C470864 wxEntryReal(int&, char**) () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxbase28_gcc.dll:??)
#9 6420588A wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int) () (D:\Programming\wxWidgets2.8\lib\gcc_dll\wxmsw28_core_gcc.dll:??)
#10 0040141A    WinMain@16(hInstance=0x400000, hPrevInstance=0x0, lpCmdLine=0x7b3a09 "", nCmdShow=10) (D:\Programming\Projects\LogicGateSimulator\jpt\jptApp.cpp:18)
#11 0040E6EB    main () (??:??)

In line 15 in jptApp.h:

15 class jptApp : public wxApp
16 {
17     public:
18         virtual bool OnInit();
19 };

Any help would be totally appreciated. Thanks a lot!!


Solution

  • If you don't do anything special in global constructors, you must have a problem with your wxWidgets build. Make sure you use the same compilation options (notably the same -I paths) when compiling your application that were used for compiling the libraries themselves.