Why use a dynamic library when only a single application will use it

  Kiến thức lập trình

I understand generally how dynamic static libraries work.
But i don’t understand why a lot of libraries online will recommend building them to be dynamic, or why some programs like Unity ship with over 30 DLL’s alongside it’s main EXE file.

To my understanding, the main benefit of dynamic libraries (.DLL/.so), is that multiple programs can use the same piece of code in memory at the same time. However often this is not the case, as mentioned with Unity, that comes with over 30 DLL’s that only it uses.
And i could imagine this affects startup time as a lot of functions have to be loaded at runtime before Unity can work.

Final question:
Should i consider using dynamic libraries for a program or app, even if said libraries will only be used by my program, and why?
(Bonus question) And why do some applications (like Unity) ship with a bunch of .DLL’s instead of Linking staticly, avoiding the downsides.

New contributor

KneeCapThief is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT