【问题标题】:ldd says "not found" even though library is in my LD_LIBRARY_PATHldd 说“未找到”,即使库在我的 LD_LIBRARY_PATH 中
【发布时间】:2014-10-08 12:20:21
【问题描述】:
$ ldd libpmsfdcwrt.so
        linux-gate.so.1 =>  (0x004ae000)
        libdl.so.2 => /lib/libdl.so.2 (0x00417000)
        [ ... elided ... ]
        libz.so.1 => not found
        [ ... elided ... ]
        libpmssl.so.0.9.7 (0xf5be8000)
        libfreebl3.so => /usr/lib/libfreebl3.so (0xf5b88000)

注意“libz.so.1 => 未找到”。

但 libz.so.1 存在:

$ ls -l /lib64/libz.so.1
lrwxrwxrwx 1 root root 13 Apr 25  2013 /lib64/libz.so.1 -> libz.so.1.2.3
$ ls -l /lib64/libz.so.1.2.3
-rwxr-xr-x 1 root root 91096 Oct  3  2012 /lib64/libz.so.1.2.3

而且,该目录列在 LD_LIBRARY_PATH 中:

$ echo $LD_LIBRARY_PATH
:/oracle/product/11.2.0/client_1/lib:/opt/CA/CAlib:/usr/local/CAlib:/opt/CA/WorkloadAutomationAE/autosys/lib:/opt/auto/ixpagent/lib:/lib64:/opt/CA/SharedComponents/lib:/usr/lib:/opt/CA/SharedComponents/Csam/SockAdapter/lib

(我退出并重新登录以确保它一直保持不变。)

【问题讨论】:

  • file /lib64/libz.so.1.2.3 输出什么?
  • 只是为了确保 - libz.so.1.2.3 存在吗?
  • readelf -a libpmsfdcwrt.so | grep PATH 输出什么?该库可能定义了一个 rpath,覆盖了 LD_LIBRARY_PATH。
  • $ 文件 /lib64/libz.so.1.2.3 产生:/lib64/libz.so.1.2.3:ELF 64 位 LSB 共享对象,x86-64,版本 1 (SYSV) , 动态链接, 剥离
  • “readelf”命令没有输出。

标签: linux


【解决方案1】:

问题是 32 位/64 位冲突:

$ file libpmsfdcwrt.so
libpmsfdcwrt.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

$ file /lib64/libz.so.1.2.3
/lib64/libz.so.1.2.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

谢谢大家为我指明正确的方向。

【讨论】:

    猜你喜欢
    • 2012-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多