我正在尝试使用 <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 修复了它。