DLL and LIB files - what and why?

后端 未结 5 688
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 17:16

I know very little about DLL\'s and LIB\'s other than that they contain vital code required for a program to run properly - libraries. But why do compilers generate them at

5条回答
  •  隐瞒了意图╮
    2020-11-28 17:58

    One important reason for creating a DLL/LIB rather than just compiling the code into an executable is reuse and relocation. The average Java or .NET application (for example) will most likely use several 3rd party (or framework) libraries. It is much easier and faster to just compile against a pre-built library, rather than having to compile all of the 3rd party code into your application. Compiling your code into libraries also encourages good design practices, e.g. designing your classes to be used in different types of applications.

提交回复
热议问题