What is a library in C language

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.