Linux library file. A. So

Source: Internet
Author: User

1.

. O is equivalent to the OBJ file in windows. a. C or. cpp file corresponds to a. o file.
. A is a combination of multiple. O files for static connections, that is, static mode. Multiple. A files can be linked to generate an EXE executable file.
. So is a shared object for dynamic connection. It is similar to Windows DLL and is loaded only when used.

TS: Error while loading shared libraries: libs. so: cannot open shared object file: no such file or directory system cannot find our own libs. so, tell him to modify the variable LD_LIBRARY_PATH.

 

2. How to generate the so dynamic library file?

Compile: Get the output file libs. o
Gcc-FPIC-g-c s. C-o libs. o

Link: Get the output file libs. So
Gcc-g-shared-wl,-soname, Libs. So-O libs. So libs. O-lC

TS: Error while loading shared libraries: libs. so: cannot open shared object file: no such file or directory system cannot find our own libs. so, tell him to modify the variable LD_LIBRARY_PATH.

 

3. How to generate a static library file?

Compile: Get the output file libs. o
Gcc-FPIC-g-c s. C-o libs. o
Ar r. a. o

 

4.

View the. A structure, find the original file, and use ar-T Yourfile.

See the dynamic library with nm-D lib *. So

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.