在编译通过以后,但是在执行的时候需要动态库,动态库找不到的话,会出现下面的错误。 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
Error While Loading Shared Libraries, Cannot Open Shared Object File
最新推荐文章于 2024-07-25 17:00:08 发布
当遇到'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通过智能技术生成