1

I'm trying to run some code using the <unbound.h> library. I'm using an example from the Unbound docs.

I compiled and installed Unbound, following these steps.

Now, I can compile the example using

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

When running ./example

I get the following error:

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

However, when I go to /usr/local/lib, I can see libunbound.so.8 and other .so files.

Why can't the linker find this file on run-time?

EDIT:

I fixed it by running /sbin/ldconfig.

Rikkert
  • 23
  • 3

1 Answers1

0

Your compile/link statement is asking for a file that does not exist. It is asking for libunbound,so but the actual name is: libunbound,so,8

To correct the problem, in the same directory as the desired file, place a link from the desired name to the actual name of the file,

user3629249
  • 16,402
  • 1
  • 16
  • 17