Home > Back-end > Of new, ask a few questions about the.lib file
Of new, ask a few questions about the.lib file
Time:01-13
Of new, ask a few questions about the.lib file:
Lib file is divided into static and dynamic, right? Static contains implementation, dynamic contains statement, equivalent to a header file right? If is static, then there is no DLL, right?
Question: 1. If you add the.lib file/link, also need a header file? Because three party libraries such as sqlite download, there is def files, and DLL files, can generate.lib file, but no header files, because do not need?
2. I have done a bit of dynamic library written in C language, are generated DLL file, through the # include "XXX. H" to use my DLL, why I don't need to generate the lib? What is the meaning of the lib exist?
CodePudding user response:
C/c + + into executable files need to be in two steps, compile + links, compiled the result is an intermediate obj files or lib, each c, or CPP compilation unit, can form a obj, link is the intermediate files and other files such as resources, combine to exe files, 1, link the lib, need header files, because some of the statement is defined as a header file to compile process, the DLL is executable file, use the DLL doesn't have to because it can use loadlibrary lib and h file, and two getprocessaddress API to obtain the output function of address, direct execution, so also called binary reuse, 2, your lib may have add to your project, it's just you didn't find,