On 25.04.2012, at 18:18, testalucida wrote: > Hi, > > this code: > > Fl_Button *pBtn = new Fl_Button(...); > pBtn->callback( [](Fl_Widget *w, void *u ) {printf(...);} ); > > compiles fine with gcc but won't with vc10. > Error message says something like "can't convert lambda to Fl_Callback*". > > Does anybody know the reason? Is there a way to use lambdas with FLTK > callbacks on Windows?
Yes. The VC2010 compiler does not support local functions. One more reason to use gcc on MSWindows. VC2010 uses an ancient single pass concept and does not implement all the new standards, or if it does, it diverges from the standard just enough to make life miserable. Try writing C++ like it was 1999, and VC may understand you better. _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk