加载共享库时出错 [英] Error loading shared libraries

查看:127
本文介绍了加载共享库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 g++ 编译器在 Ubuntu 上运行 eclipse,并且我正在尝试运行一个使用 xerces 的示例程序.

I'm running eclipse on Ubuntu using a g++ compiler and I'm trying to run a sample program that utilizes xerces.

构建没有产生任何错误,但是当我尝试运行该程序时,我会收到此错误:

The build produced no errors however, when i attempted to run the program, I would receive this error:

加载共享库时出错:libxerces-c-3.1.so:无法打开共享对象文件:没有这样的文件或目录

libxerces-c-3.1.so 位于目录 /opt/lib 中,我已将其作为库包含在 eclipse 中.当我检查文件夹时,文件就在那里.当我执行 echo $LD_LIBRARY_PATH 时,还会列出 /opt/lib.

libxerces-c-3.1.so is in the directory /opt/lib which I have included as a library in eclipse. The file is there when I checked the folder. When I perform an echo $LD_LIBRARY_PATH, /opt/lib is also listed.

对问题所在的任何想法?谢谢.

Any ideas into where the problem lies? Thanks.

ldd libxerces-c-3.1.so 命令产生以下输出:

linux-vdso.so.1 =>  (0x00007fffeafff000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00007fa3d2b83000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa3d2966000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fa3d265f000)
libm.so.6 => /lib/libm.so.6 (0x00007fa3d23dc000)
libc.so.6 => /lib/libc.so.6 (0x00007fa3d2059000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fa3d1e42000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa3d337d000)

推荐答案

我将所有库文件从/opt/lib 复制到/usr/lib 中,程序现在可以运行了.感谢您的回复.

I copied all the library files from /opt/lib into /usr/lib and the program works now. Thanks for the response.

这篇关于加载共享库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆