ld在错误的路径上搜索,并搜索错误的库

时间:2016-09-07 23:30:27

标签: linux ubuntu linker ld

我正在尝试在我的机器上编译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

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

要添加的另一件事:我在lib64下没有/usr/local/目录(只有lib存在)。当我执行arch时,它会给我x86_64

1 个答案:

答案 0 :(得分:1)

如果你没有特殊的理由自己构建,请从包中安装libswutil。

apt-get install libwsutil-dev

Wireshark也有包装,你不需要任何开发包:

apt-get install wireshark

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