17

我正在尝试启动并运行系统,但 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 位的东西吗?

4

2 回答 2

16

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

于 2012-04-26T20:38:33.143 回答
16

The binaries I had were looking for the 32-bit versions of the shared libraries, I had the 64-bit installed. Stupid mistake. LDD didn't produce a very insightful error message, but the binary did when I tried to run it.

于 2012-04-26T21:43:43.263 回答