Introduction to the/etc/ld. so. conf file

Source: Internet
Author: User
/Etc/ld. so. conf file introduction/etc/ld. so. conf this file records the path of the dynamic library used during compilation, that is, the path for loading the so Library. By default, the compiler only uses the library files under the/lib and/usr/lib directories. when installing the files through the source code package, such... /etc/ld. so. conf file introduction/etc/ld. so. conf this file records the path of the dynamic library used during compilation, that is, the path for loading the so Library. By default, the compiler only uses the library files under the/lib and/usr/lib directories, if -- prefix is not specified, the database will be installed in the/usr/local directory, but not in the file/etc/ld. so. add the/usr/local/lib directory to the conf file. In this way, even if the source code package is installed, the related. so Library cannot be found during use, and an error will be reported. That is to say, the system does not know that the source code package is installed. Www.2cto.com has two solutions for this situation: (1) when using the source code for installation, use -- prefix to specify the installation path as/usr/lib. In this case, you do not need to configure PKG_CONFIG_PATH (2) to directly add the path/usr/local/lib to the/etc/ld. so. conf file. Add/usr/local/lib directly at the end of the/etc/ld. so. conf file (this method is awesome !) Ldconfig let's take a look at the ldconfig program, which is located under/sbin. its function is to set the file/etc/ld. so. the library files in the path listed in conf are cached to/etc/ld. so. cache for use, so when some library files are installed or/etc/ld. so. conf adds a new search path for the database. you need to run ldconfig to cache all the database files to the file/etc/ld. so. cache. if not, you may not be able to find the library you just installed. PKG_CONFIG_PATH: www.2cto.com. the environment variable PKG_CONFIG_PATH appears after pkg-config is installed. In fact, pkg-config is a program that provides system information to the configure program, for example, the software version, library version, library path, and so on are only used during compilation. You can see a lot of * in ls/usr/lib/pkgconfig *. pc, open it in a text editor and you will find information similar to the following: prefix =/usr exec_prefix = $ libdir = $/lib includedir = $/include glib_gen1_al = glib-gen1_al gobject_query = gobject-query glib_mkenums = glib-mkenums Name: GLib Description: C Utility Library Version: 2.4.7 Libs:-L $-lglib-2.0 Cflags:-I $/glib-2.0-I $/glib-2.0/include understand, configure determines whether your software version meets the requirements based on the information. And get the location where these things are located, or where to find them. I don't need to say that you also know why the above problems have occurred. So configure the environment variable correctly. my configuration is PKG_CONFIG_PATH =/usr/lib/pkgconfig:/usr/local/lib/pkgconfig.
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.