LDD找不到LD_LIBRARY_PATH库(ldd can't find library

2019-07-29 03:49发布

我试图让系统启动和运行,并因与openmotif的共享库的问题。 我有自己的LD_LIBRARY_PATH目录,但它仍然无法找到他们。

下面是一个例子:

[root@intrepid netcool]# ldd /opt/netcool/omnibus/platform/linux2x86/bin/nco_* |grep 'not found'
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
[root@intrepid netcool]# find /usr/ -name libXm.so.3 
/usr/lib64/libXm.so.3
[root@intrepid netcool]# find /usr/ -name libXpm.so.4
/usr/lib64/libXpm.so.4
[root@intrepid netcool]# echo $LD_LIBRARY_PATH
/opt/netcool/omnibus//platform/linux2x86/lib/:/opt/netcool//platform/linux2x86/lib/:/usr/lib/:/usr/lib64/

我可能做一些愚蠢的事,但我想不出别的尝试。

编辑:要回答几个下面提出的问题:

[root@intrepid netcool]# export LD_LIBRARY_PATH
[root@intrepid netcool]# ldd /opt/netcool/omnibus/platform/linux2x86/bin/nco_* |grep 'not found'
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
[root@intrepid netcool]# ldconfig
[root@intrepid netcool]# ldd /opt/netcool/omnibus/platform/linux2x86/bin/nco_* |grep 'not found'
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found

好吧,只是试图运行可执行文件之一:

# ./bin/nco_xigen 
/opt/netcool//omnibus/platform/linux2x86/bin/nco_xigen: error while loading shared libraries: libXm.so.3: wrong ELF class: ELFCLASS64

这是一个32位/ 64位的事情吗?

Answer 1:

你导出LD_LIBRARY_PATH? 在export关键字告诉Bash任何变量发送给子进程-否则ldd的将永远不会看到LD_LIBRARY_PATH。



Answer 2:

我不得不寻找的共享库的32位版本的二进制文件,我已经安装了64位。 愚蠢的错误。 LDD没有产生一个非常有见地的错误消息,但二进制没有当我试图运行它。



文章来源: ldd can't find library in LD_LIBRARY_PATH