Yes, /M flag was changed for all modules, and this is what I did,
because otherwise you can't link without errors.

I prefer not to have DLL linking because it requires you include
VC++ redistributable in your installation script, or program may not
run. I had problems with some users who ran into this.

Best Regards,
Mikhail

>
> The /M flag must be changed for *all* linked modules. It must be the =
> same in each and every module that you link. If you change the flag, you =
> must make sure that FLTK and all other modules are build from scratch, =
> or you will get exactly the heap corruption that you described.=20
>
> We chose the /M flag very carefully. It i set to multithreading with dll =
> support. IMHO the only correct setting if you want to do any kind of =
> run-time linking, or link with any dll at all.
>
> On 30.06.2012, at 00:37, Mikhail Tchernychev wrote:
>
> > Here what I just did to reproduce:
> >=20
> > Downloaded latest r9631;
> >=20
> > Changed "code generation" to /MTd
> > for hello, fltkdll, fltkjpeg, fltkzlib, fltkpng
> >=20
> > Explicitly changed it to /MTd for file jmemobs.c from JPEG
> >=20
> > Changed project reference for hello to fltkdll
> >=20
> > Removed fltkd.lib from link
> >=20
> > changed subsystem for hello to "console" (if not, it expects
> > WinMain)
> >=20
> > Compiled.
> >=20
> > Now it runs. Added destructor. Now it crashes.
> >=20
> >=20
> > I used static linking at home and /MDd at home and I recall
> > it worked.
> >=20
> >=20
> > I hope it helps.
> >=20
> > Best Regards,
> > Mikhail
> >=20
> >=20
> >> Hmm, Mikhail, it works absolutely correctly without any errors on my =
> system (Windows Seven 64, VC2010 Express, Debug, latest svn rev 9631).
> >> I'm afraid it's problem with your machine only. Which version of FLTK =
> do you use? Do you use something else? Be sure you don't mix headers and =
> ..lib files from different versions of the library.
> >>=20
> >>=20
> >>> This is happens in Debug build. It's actually
> >>> "Debug Assertion Failed" showing that heap is
> >>> corrupted. Stack is not useful. Going step by step
> >>> I found that it happens after ~Fl_Window();
> >>> xclass in Fl_Window is set to NULL.
> >>> The program is here:
> >>>=20
> >>> #include <FL/Fl.H>
> >>> #include <FL/Fl_Window.H>
> >>> #include <FL/Fl_Box.H>
> >>>=20
> >>> //#include <vld.h>
> >>>=20
> >>> int main(int argc, char **argv) {
> >>> //        Fl_Window window(340,180);;
> >>>=20
> >>>  Fl_Window *window =3D new Fl_Window(340,180);
> >>>  Fl_Box *box =3D new Fl_Box(20,40,300,100,"Hello, World!");
> >>>  box->box(FL_UP_BOX);
> >>>  box->labelfont(FL_BOLD+FL_ITALIC);
> >>>  box->labelsize(36);
> >>>  box->labeltype(FL_SHADOW_LABEL);
> >>>  window->end();
> >>>  window->show(argc, argv);
> >>>  int ret =3D Fl::run();
> >>>  delete window;
> >>>=20
> >>>  return 0;
> >>> }
> >>=20
> >> Nikita Egorov
> >>=20
> >>=20
> >=20
> > _______________________________________________
> > fltk-dev mailing list
> > fltk-dev@easysw.com
> > http://lists.easysw.com/mailman/listinfo/fltk-dev
>

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to