Solution: "error while loading shared libraries: libxxxx"

Source: Internet
Author: User

When C/C ++ProgramDuring compilation or connection, errors such as error while loading shared libraries are often displayed. The main reason is that a dynamic or static library cannot be found. This situation is often caused by the use of function libraries other than the system library.

I encountered an error when using Libpcap. This is because the function library is usually installed. When the make install method is used, the. So file and. A file of the function library will be copied to/usr/local/lib by default. However, this path is not in the path of the connected database of the system. Therefore, an error occurs.

 

 

Solution: Add "/usr/local/lib" to the end of the/etc/lD. So. conf file, and run/sbin/ldconfig-V as the root user. Where/etc/lD. so. the conf file records the path of the library to be dynamically connected during compilation. The ldconfig command is mainly used in the default search directory (/lib and/usr/lib) and the dynamic library configuration file/etc/lD. so. under the directory listed in Conf, search
Obtain the shared dynamic link library (the format is as described earlier, lib *. so *) to create a dynamic loader (LD. so) the required connection and cache file. the default cached file is/etc.
/LD. So. cache, which saves the list of sorted Dynamic Linked Library names. See http://www.xxlinux.com/linux/article/accidence/technique/20081230/14754.html

Related Article

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.