Error while loading shared libraries errors solution
After compiling yaml-cpp and using Ros camera drivers, an error occurred: "Error while loading shared Libraries:libyaml-cpp.so.0.5:cannot 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 xxx.so 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 ld.so.conf
It is a good idea to add the path of your own possible repository files to/etc/ld.so.conf. The following are the specific practices:
Opens the Ld.so.conf 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: http://blog.csdn.net/wallwind/article/details/7580659
Reference website: http://blog.csdn.net/david_xtd/article/details/7625626/
Reference website: http://blog.csdn.net/dumeifang/article/details/2963223
Reference website: http://blog.sina.com.cn/s/blog_54f82cc201011ve4.html
Settings for Linux libraries: ld.so.conf files and Pkg_config_path variables
Reference website: http://www.linuxidc.com/Linux/2011-03/33432.htm