When using TC to write a program, you may have questions about the *.lib files, what are the uses of these lib files? When programming in C, it is often necessary to establish some user functions. If these functions are generic, the general approach is to make them into a header file and include them in the source program with the "# include" command when needed to improve programming efficiency. However, in a particular program, only part of these functions are generally used, if the above method contains all functions, the compiler will compile all the included functions are compiled, which will undoubtedly make the source program large and difficult to understand, and will affect the efficiency of execution. Set up the user Target Module library (LIB file) can solve this problem, you can pre-set a specific function of the universal sub-function sets compiled after the creation of the obj file into the Lib file, When the linker tlink.exe the link operation, it only links the obj file where the common function used inside the program is located (verified: cannot be located to a specific function), so the resulting obj file will be leaner and the resulting EXE file smaller. In fact, a Lib file is a collection of obj files. Of course, there are some other ancillary information, which is intended to allow the compiler to accurately locate the corresponding obj file. We can operate the Lib file by Tlib.exe (root directory under tc2.0), you can add the obj file you generated through the Tlib command to a Lib file, you can delete the obj file in the Lib file, and you can extract the internal obj file. Understand the approximate structure of LIB file and the specific operation of it, in the process of learning C language, there will be a further point in the implementation of C language to study.
What is a library in C language