Turn ?????? Roles of files in the/etc/lD. So. conf. d/directory

Source: Internet
Author: User

Before learning about the functions of files in the/etc/lD. So. conf. d/directory, we will first introduce several methods for running programs to load dynamic libraries:
First, run the ldconfig command
The ldconfig command is mainly used in the default search directory (/lib and/usr/lib) and dynamic library configuration file/etc/lD. so. search for the shared dynamic link library (Format: lib *. so *) to create a dynamic loader (LD. so) the required connection and cache file. the default cached file is/etc/lD. so. cache. This file stores the list of Dynamic Linked Library names in the sorted order.
The key content involved here is the command ldconfig, configuration file directory:/etc/lD. so. conf. d. The configuration file is in/etc/lD. so. the conf content is edited by the user and buffered file/etc/lD. so. cache. The following is an example. For example, when you deploy software, some dynamic libraries are installed in the EXE Directory, which can be implemented using the following method,
1) configure the exe. conf file and add a line ~ /EXE, and then put the file under the/etc/lD. So. conf. d directory;
2) add an include lD. So. conf. d/EXE. conf line to the/etc/lD. So. conf file.
3) execute the ldconfig command
When the program runs, it will automatically add a dynamic library to search for in the EXE directory.
Second, use the LD_LIBRARY_PATH environment variable
You can. bashrc or. the environment variable is configured in cshrc. LD_LIBRARY_PATH indicates the directories in which the loader can find the shared library. you can set multiple search directories separated by colons.
The above example can also be implemented through the above method.
Add a row in. bashrc or. cshrc, export LD_LIBRARY_PATH = ~ /EXE: $ LD_LIBRARY_PATH.

Third, use the compilation option-WL and-rpath to specify the dynamic search path.
The-wl option tells the compiler to pass the following parameters to the linker.
Through the above introduction, the functions of/etc/lD. So. conf. d/are clearer.

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.