Linux Setup Ld_library_path

Source: Internet
Author: User

 while loading shared libraries:libmysqlclientso.so. 0 Object file:no Such file or directory this is because the path to the dynamic link library is not placed in the variable Ld_library_path. You can execute the =shell command: Export ld_library_path= your own dynamic link library path: $LD _library_path
The export statement is added to the ~/.BASHRC or ~/.bash_profile, which is read once per login and every time the shell is opened, which is read only once at login.
My habit is to add to ~/. BASHRC, in the end of the file, you can use the following statement to make the setting effective: Export Ld_library_path= $LD _library_path:/usr/local/lib after modification , remember to turn off the current terminal and reopen a new terminal to make the above configuration effective. 
However, this environment variable is based on the shell, which means that it only works in the currently set shell, so every time you open a new shell run program, Ld_library_path is set.
is a very troublesome thing, so we would like to have nothing to do once and for all, so that after the setup will not have to set up? The answer is yes, open the. bash_profile file in the ~/directory, set the environment variable as follows: Ld_library_path=dir: $LD _library_pathexport Ld_library_ Pathld_library_path This environment variable is the most familiar to everyone, it tells loader: in which directories can find the shared library. You can set up multiple search directories separated by colons.
Under Linux, there is another way to do the same, you can add these directories to/etc/ld.so.conf, and then call Ldconfig.
Of course, this is a system-wide, globally valid, environment variable that is valid only for the current shell. By convention, unless you specify in the above manner,
Loader is not going to find a shared library in the current directory, just as the shell will not be looking for an executable file currently.

Linux Setup Ld_library_path

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.