Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the differences between .dll , .lib, .h files?

Why in a project should I include some *.lib, .h or some other files? And what are these things used for?

like image 926
MemoryLeak Avatar asked Nov 22 '09 07:11

MemoryLeak


People also ask

What is the difference between .LIB and DLL?

LIB vs DLLLIB is a static library where functions and procedures can be placed and called as the application is being compiled. A DLL or Dynamic Link Library does the same function but is dynamic in a sense that the application can call these libraries during run-time and not during the compilation.

Does a DLL need a lib file?

lib must be passed to the linker. The second one is explicit linking when we use the DLL by manually loading it with LoadLibrary function. In this type we don't need that . lib file, but we must put a little effort to find DLL exports, their addresses, and call these functions through pointers.

What is the difference between DLL and API?

A DLL is just a file on Windows systems that has some code in that can be used by other executable files. An API is a way of using one piece of software, or a software library, to be used with another.

What do .LIB files contain?

lib file contains all the code and data for the library. The linker then identifies the bits it needs and puts them in the final executable. For a dynamic library, the . lib file contains a list of the exported functions and data elements from the library, and information about which DLL they came from.


2 Answers

  • .h: header file, its a source file containing declarations (as opposed to .cpp, .cxx, etc. containing implementations),

  • .lib: static library may contain code or just links to a dynamic library. Either way it's compiled code that you link with your program. The static library is included in your .exe at link time.

  • .dll: dynamic library. Just like a static one but you need to deploy it with your .exe file because it's loaded at run time.

like image 113
siukurnin Avatar answered Sep 21 '22 03:09

siukurnin


  • H Declares the interface to a library - including functions, structures, and constants. Written in the C language.
  • LIB Either declares the binary interface to a dynamic library (DLL) or contains the binary code of a library.
  • DLL A dynamic library - your application shares these with the system or you use them to keep your code base organized.
  • DEF A textual description of functions exported by a DLL.
like image 28
Frank Krueger Avatar answered Sep 21 '22 03:09

Frank Krueger