【问题标题】:ld searching in the wrong path, and searching for the wrong libraryld 搜索错误的路径,并搜索错误的库
【发布时间】:2017-01-15 18:24:32
【问题描述】:

我正在尝试在我的机器上编译wireshark,因为我需要添加一些自定义插件。当我运行make install 时,我收到消息:

/usr/bin/ld: cannot find -lwsutil

运行命令ld -lwsutil --verbose 给出(最后几行)

attempt to open //usr/local/lib/x86_64-linux-gnu/libwsutil.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libwsutil.a failed
attempt to open //lib/x86_64-linux-gnu/libwsutil.so failed
attempt to open //lib/x86_64-linux-gnu/libwsutil.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libwsutil.so failed
attempt to open //usr/lib/x86_64-linux-gnu/libwsutil.a failed
attempt to open //usr/local/lib64/libwsutil.so failed
attempt to open //usr/local/lib64/libwsutil.a failed
attempt to open //lib64/libwsutil.so failed
attempt to open //lib64/libwsutil.a failed
attempt to open //usr/lib64/libwsutil.so failed
attempt to open //usr/lib64/libwsutil.a failed
attempt to open //usr/local/lib/libwsutil.so failed
attempt to open //usr/local/lib/libwsutil.a failed
attempt to open //lib/libwsutil.so failed
attempt to open //lib/libwsutil.a failed
attempt to open //usr/lib/libwsutil.so failed
attempt to open //usr/lib/libwsutil.a failed
attempt to open //usr/x86_64-linux-gnu/lib64/libwsutil.so failed
attempt to open //usr/x86_64-linux-gnu/lib64/libwsutil.a failed
attempt to open //usr/x86_64-linux-gnu/lib/libwsutil.so failed
attempt to open //usr/x86_64-linux-gnu/lib/libwsutil.a failed

我可以从这里看到两件事:它试图打开的目录上有一个额外的斜线(这样可以吗?) 目录错误:我可以在/usr/local/lib 看到wsutil 它尝试查找的文件也是错误的 - 对于 wsutil,这些文件是:

libwsutil
libwsutil.3
libwsutil.3.0.0
libwsutil.la

我应该从哪里着手解决这些问题?

更新:运行ls -lh /usr/local/lib/libwsutil* 给出

lrwxrwxrwx 1 root root  15 Sep  8 11:22 /usr/local/lib/libwsutil -> libwsutil.3.0.0
lrwxrwxrwx 1 root root  15 Sep  8 11:22 /usr/local/lib/libwsutil.3 -> libwsutil.3.0.0
-rwxr-xr-x 1 root root 65K Sep  8 11:22 /usr/local/lib/libwsutil.3.0.0
-rwxr-xr-x 1 root root 866 Sep  8 11:22 /usr/local/lib/libwsutil.la

另外,我在 Ubuntu 16.04 上安装的 wireshark 版本是 1.10.8。

还要补充一点:我在/usr/local/ 下没有lib64 目录(仅存在lib)。当我执行 arch 它给了我x86_64

【问题讨论】:

  • 您能否更新您的问题以包含ls -lh /usr/local/lib/libwsutil* 的输出?
  • @redneb 更新
  • 那里应该有一个*.so 文件,这就是ld 正在寻找的。你是如何安装wireshark的(我相信它提供了那个库)?也许您可以尝试使用包管理器重新安装它。

标签: linux ubuntu linker ld


【解决方案1】:

如果您没有特殊原因要自己构建,请从包中安装 libswutil。

apt-get install libwsutil-dev

Wireshark 也可以打包使用,您不需要任何开发包:

apt-get install wireshark

大部分自定义插件都是用 Lua 编写的,所以你根本不需要编译 wireshark。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-02
    • 1970-01-01
    • 1970-01-01
    • 2011-10-30
    • 1970-01-01
    • 2022-12-15
    • 2011-06-20
    相关资源
    最近更新 更多