Static Library Link

Source: Internet
Author: User

Back to our hello World analysis, this program is useful because of output. That is to say, output Hello World to the screen.

 

So how does he achieve this? The simplest method is to use the application programming interface provided by the OS. That is, the API.

 

In general, a language development environment usually comes with a language library. These libraries are the encapsulation of operating system APIs.

 

For example, in Hello world, the printf of the standard library is used to output the text information "Hello world". In fact, the prinf function is actually running on the string.

 

After some necessary processing, the operation system API will be called at last. In Linux. Is the system call of the called write.

 

 

Of course, there are many functions in the C language library that do not need to call system APIs, such as strlen () functions.

 

Therefore, the static library can be viewed as a set of target files. Is a file formed after many target files are compressed and packaged.

 

For example, run the usr/lib directory under Ubuntu and enter the command

 

Ls-L *.

 

 

In fact, this. A is an important static library in Ubuntu. We analyzed it using Ar-T and found that it actually contains several. O files.

 

Of course, in Ubuntu, dynamic loading is often used. For example, our hello World Program

 

 

These so libraries are dynamic link libraries.

Static Library Link

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.