Article #371: Why Does FLTK Use the DLL Link Model?

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]

Return to Articles | Show Comments | Submit Comment ]

Article #371: Why Does FLTK Use the DLL Link Model?

Created at 07:59 Jan 29, 2005 by mike

Microsoft's fundamental problem with its three different styles (actually six) of linking libraries is exactly that: a Microsoft problem.

The word DLL in the linker setting is completely misleading. What it means is that your application and any STATIC libraries in your app will be linked against the DYNAMIC stdc libraries. The library that you create can still be dynamic or static.

Failing to link with the dynamic stdc libaries will generate a new instance of the stdc library for every lib that you link with. Every stdc library has its own heap, its own static variables, and needs its own full space. And now you are in big trouble.

Example: you have two libraries, statically linked, both created with single- or multi-threaded, but not with the DLL option. If your application now uses the one library to allocate some memory space, it uses the stdc library in the first library. If for whatever reason you free the same space from within the other library, your application will crash because it can't find the block that you free in its heap - with a good chance of creating the BSOD on Win9x/Me.

As a nice extra effect of using DLL, your code will be a few 100k less per library that you link.

That's why we do not provide the other methods. If you believe you MUST use another model, it is as simple as changing a single pulldown menu in the linker settings.

Download | Home Page | Listing ]


Submit Comment ]

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.