I am using CodeLite to create a Fltk project.Everthing seems fine but when I press F5 to debug it,it always crashed with a "Program Received signal SIGSEGV" tips. Here is the call stack:
0 0x00401c66 Fl_Widget::Fl_Widget(int, int, int, int, char const*)
1 0x0040a6b1 Fl_Group::Fl_Group(int, int, int, int, char const*)
2 0x004097bf Fl_Window::Fl_Window(int, int, char const*) 3 0x00401415 main
I am sure the code have no problems because i had made it successfully by using CodeBlocks;
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
using namespace std;
//--------------------------------------------
void but_cb( Fl_Widget* o, void* ) {
Fl_Button* b=(Fl_Button*)o;
b->label("Good job"); //redraw not necessary
b->resize(10,150,140,30); //redraw needed
b->redraw();
}
//--------------------------------------------
int main() {
Fl_Window win( 300,200,"Testing" );
win.begin();
Fl_Button but( 10, 150, 70, 30, "Click me" );
win.end();
but.callback( but_cb );
win.show();
return Fl::run();
}
the build log,maybe useful:
C:\windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f "CL_TESL_wsp.mk"" ----------Building project:[ HelloFltk - Debug ]----------" mingw32-make.exe[1]: Entering directory
G:/CPP/CL_TESL/HelloFltk' g++ -o ./Debug/HelloFltk @"HelloFltk.txt" -L. -LG:/MinGW-4.7.1/lib/ -LG:/FLTK/fltk- 1.3.2/lib/ -LG:/FLTK/fltk-1.3.2/ -LG:/MinGW-4.7.1/lib/ -lgdi32 -lfltk -lfltk_forms -lfltk_gl -lfltk_images -lfltk_z -lgdi32 -lole32 -luuid -luser32 -lcomctl32 mingw32-make.exe[1]: Leaving directory
G:/CPP/CL_TESL/HelloFltk' 0 errors, 0 warnings
A new situation!! Today I update my CodeBlocks to the newest version,and it occurs the same problem.I think it is relavent to the version of MinGW...I remake the FLTK by using new version of MinGW,doesn't work either... So I have to change the CodeLite's MinGW path to the old one,and it works...Why couldnt I use the newest version?