Specify the path of the dynamic link library *. so file -- Better Way
Source: Internet
Author: User
Specify the path of the dynamic link library *. so file -- a better method -- general Linux technology-Linux programming and kernel information. For details, see the following. 1. Modify LD_LIBRARY_PATH to specify the path of the shared library. LD_LIBRARY_PATH: The environment variable indicates the path where the dynamic connector can load the dynamic library.
Run the following command on the terminal:
[Root @ localhost sharelib] # export LD_LIBRARY_PATH =.
Or
[Root @ localhost sharelib] # export LD_LIBRARY_PATH = your lib dir
2. Specify the directory of the dynamic library through the/etc/ld. so. conf file. Run the ldconfig command to update the path of the shared library. This usually solves the problem that the database cannot be linked. This method is once and for all.
3. Copy the library file to/lib, and then ldconfig. This method is a good method and destroys the purity of the original library file. It should not be the first method.
The first method is not convenient; the second method is not available on my machine; the third method is not convenient to modify at any time, and it is troublesome; the last method is better:
Add the following content to the. bashrc file in the main Folder:
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH :./
Of course, if ksh or csh is used, add the above content under. kshrc and. cshrc.
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