0

我正在尝试使用 <unbound.h> 库运行一些代码。我正在使用Unbound 文档中的示例。

我按照这些步骤编译并安装了 Unbound 。

现在,我可以使用编译示例

gcc -o example eample_1.c -I/usr/local/include -L/usr/local/lib -lunbound

运行时 ./example

我收到以下错误:

./example: error while loading shared libraries: libunbound.so.8: cannot open shared object file: No such file or directory

但是,当我转到 /usr/local/lib 时,我可以看到 libunbound.so.8 和其他 .so 文件。

为什么链接器在运行时找不到这个文件?

编辑:

我通过运行 /sbin/ldconfig 修复了它。

4

1 回答 1

0

您的编译/链接语句要求一个不存在的文件。它要求libunbound,so但实际名称是:libunbound,so,8

要更正此问题,请在与所需文件相同的目录中,放置从所需名称到文件实际名称的链接,

于 2021-04-07T09:41:19.680 回答