What to do if linux cannot find lib

藏色散人
Release: 2023-02-28 09:59:51
Original
3604 people have browsed it

Solution to the problem that Linux cannot find lib: 1. Copy the lib library in the program to the "/lib" or "/usr/local/lib" directory, and then execute "ldconfig"; 2. In Add the directory where the library file is located to "ld.so.conf", and then update the "ld.so.cache" file.

What to do if linux cannot find lib

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

linux What should I do if I can’t find the lib?

The Lib library cannot be found when running the program under Linux. Solution

1. For example,

error while loading shared libraries: xxx: cannot open shared object file: No such file or directory
Copy after login

Method 1:

1. Enter the program Copy the lib library to the /lib or /usr/local/lib directory

2. The purpose of executing the ldconfig

ldconfig command is mainly to search in the default search directories (/lib and /usr/ lib) and the directory listed in the dynamic library configuration file /etc/ld.so.conf

Method 2:

# vim /etc/ld.so.conf //在新的一行中加入库文件所在目录
/xx//xxxxx 

# ldconfig //更新/etc/ld.so.cache文件
Copy after login

Recommended study:《 Linux video tutorial

The above is the detailed content of What to do if linux cannot find lib. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template