Linux programming dynamic library knowledge, linux programming dynamic

Source: Internet
Author: User

Linux programming dynamic library knowledge, linux programming dynamic

=== Dynamic library description ====
1. Library name format: lib + the_name_of_library +. so + version_number
Exp: libc. so.6
2. ldconfig generally creates soname, but does not create linker name (libname. so ).
3. Temporarily Add the dynamic library directory LD_LIBRARY_PATH for testing and development.
4. LD_PRELOAD: pre-load the library. Used for early loading, emergency use, or special testing
5. Create a dynamic library
Gcc-fPIC-shared-Wl,-soname, your_soname-o library_name \
File_list library_list
6. ldconfig directory Loading Sequence
Run the command in the order of the configuration directory.
If you encounter include ld. so. conf. d/*. conf, these configurations are listed in ascending alphabetical order.
7. When compiling a program or library, the. o file will be included in the program or library, but the dynamic library will not.
Undefined symbols. The search symbols are searched from left to right until they are found. The search is stateless and does not
Records the symbols found, so it is generally recommended that. o be placed before the compilation option, so file is placed behind, according
Dependency order placement: the dependent object is placed on the right of the dependent object

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.