Error while loading shared libraries errors solution

Source: Internet
Author: User

Error while loading shared libraries errors solution

After compiling yaml-cpp and using Ros camera drivers, an error occurred: "Error while loading shared open Shared object file: No such file or directory.

Search some articles on the net, found: After the installation is complete, often encounter the following problems error while loading shared libraries, that is, the compiler did not find the corresponding Lib library file.

This kind of error indicates that the system does not know in which directory, in general, a lot of so will be stored in the directory under/usr/local/lib, go to this directory to find, sure enough to find the. so file.

Library files are used when connecting (static libraries and shared libraries) and running (limited to programs that use shared libraries), and their search paths are set in the system. The general system/lib and/usr/lib two directories as the default library search path, so using the libraries in these two directories does not need to set the search path can be used directly. For libraries that are outside the default library search path, you need to add the location of the library to the search path of the library.

There are two ways to set the search path for a library file, which can be used as one of the following:

1) Modifying a configuration file

It is a good idea to add the path of your own possible repository files to/etc/ The following are the specific practices:

Opens the file inside the add:/usr/local/lib

Or use another approach: Create usr-libs.conf in/ETC/LD.SO.CONF.D, create a method to use VI usr-libs.conf ( then press the letter I on the keyboard to enter insert mode, add /usr/ After Local/lib, press ZZ to save and exit )

Then execute the ldconfig. PS: Some articles are re-run:/sbin/ldconfig–v. The specific one did not try, I use the following method.

Note that you need to use root permissions, directly sudo su can be, return to normal User: SU user name

2) Modify the environment variable Ld_library_path

The steps are as follows:

Enter in Terminal: VI ~/.BASHRC

Using E (that is, edit mode), enter insert mode by letter I, add:

Export Ld_library_path=/usr/local/lib:

Press ESC to exit Insert mode, and then press ZZ to save and exit.

Reference website:

Reference website:

Reference website:

Reference website:

Settings for Linux libraries: files and Pkg_config_path variables

Reference website:

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: 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.