Error While Loading Shared Libraries, Cannot Open Shared Object File

当遇到'Error While Loading Shared Libraries, Cannot Open Shared Object File'错误时,可以通过重新编译源代码指定路径、创建软链接、拷贝库文件、设置LD_LIBRARY_PATH或更新ld.so.conf来解决。例如,针对libev.so.4找不到的情况,可以创建从/usr/local/lib到/usr/lib的软链接,并运行ldconfig更新缓存。" 110636206,9905981,使用SpreadJS构建企业在线表格协同编辑平台,"['前端开发', 'HTML', 'CSS', 'JavaScript', 'Vue.js']
摘要由CSDN通过智能技术生成
在编译通过以后,但是在执行的时候需要动态库,动态库找不到的话,会出现下面的错误。
error while loading shared libraries: libev.so.4: cannot open shared object file: No such file or directory。
首先判断你的可执行程序需要哪些动态库,然后查看哪些动态库是这个程序找不到的!libev这个库编译好以后会自动添加到/usr/local/lib目录下,这个目录下有静态库和动态库

$ ls -l /usr/local/lib/libev*
-rw-r--r--. 1 root root 435770 Feb 22 15:20 /usr/local/lib/libev.a
-rwxr-xr-x. 1 root root 926 Feb 22 15:20 /usr/local/lib/libev.la
lrwxrwxrwx. 1 root root 14 Feb 22 15:20 /usr/local/lib/libev.so -> libev.so.4.0.0
lrwxrwxrwx. 1 root root 14 Feb 22 15:20 /usr/local/lib/libev.so.4 -> libev.so.4.0.0
-rwxr-xr-x. 1 root root 174059 Feb 22 15:20 /usr/local/lib/libev.so.4.0.0

然后查看自己的程序是需要哪些是动态库:
$ ldd /usr/local/bin/weighttp
        linux-vdso.so.1 =>  (0x00007fff251ff000)
        libev.so.4 => not found
        libpthread.so.0 => /lib64/libpthread.s
This error message usually appears when a program is unable to find a required shared library file. This can happen for a variety of reasons, such as: - The library file is missing or has been deleted. - The library file is located in a different directory than the one the program is looking in. - The program does not have permission to access the library file. To fix this error, you can try the following steps: 1. Check if the required library file is installed on your system. You can do this by running the following command in the terminal: ``` $ sudo ldconfig -p | grep <library_name> ``` Replace `<library_name>` with the name of the library file that the program is looking for. If the library file is not listed, you may need to install it using your system's package manager. 2. Check if the library file is located in the correct directory. Shared library files are typically located in `/usr/lib` or `/usr/local/lib`. You can check if the file is in one of these directories by running the following command in the terminal: ``` $ find /usr/lib -name <library_name> ``` Replace `<library_name>` with the name of the library file. If the file is not in the correct directory, you may need to move it to the correct location. 3. Check if the program has permission to access the library file. Make sure that the file permissions are set correctly and that the program has the necessary permissions to access the file. If none of these steps work, you may need to reinstall the program or the library file.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值