Difference Between Static And Dynamic L

Started by
1 comment, last by Aldenar 18 years, 11 months ago
I know that a DLL has its own heap space but that is about it. Why do commercial engines have DLLs and not LIBs? ace
Advertisement
So that parts can be updated without recompiling the entire application. Additionally, some modules might need to be hardware-specific. They might write different renderers for nividia and ati cards, because they support different extensions or whatehaveyou. They can either write an app and 2 dlls, or distribute two seperate executables. Couple this with a generic sound module and one that takes advantage of the latest and greatest audigy, and now you have 4 different executables. And then if they find a bug in one module, they have to release new executables - or they could just release a new dll.
Just a few thoughts :)

DLLs have a few advantages such as:

1. You can update/fix a DLL without recompiling the entire executable.

2. By dropping a new DLL / extending an existing one, you can easily add functionnality to a game. A plugin system for example or a patch that enables a new effect.

3. It can make the package smaller since the code is only present once. For example, say you have an engine that allows users to create plugins. They will have to be connected to the main engine. When using LIBs, they will be statically linked and the code will be duplicated in each and every plugin. Also, say one of the library is a memory manager, if you link with static LIBs, you'll end up duplicating that memory manager and it is probably something you don't want to do. Version management can be a bit easier with DLLs since it makes sure that all components are using the same version of the engine's code.


But, there are also a few downsides to dynamic libraries like making sure you have all the necessary DLLs, and that they are all up to date.

This topic is closed to new replies.

Advertisement