Why is my shared library not found?

I am trying to compile an example program that references a shared library created by Sundown . I compile the program as follows.

$ gcc -o sd sundown.c -L. -lsundown

However, when I run it, I get the following error.

./sd: error while loading shared libraries: libsundown.so: cannot open shared file object: No such file or directory

lsThere is a conclusion .

$ ls
libsundown.so  libsundown.so.1  sundown.c  sd

Why is the shared library not found ld?

+1
source share
1 answer

Short decision:

. ( -L) LD_LIBRARY_PATH. sd, ​​LD_LIBRARY_PATH. : ., , sd , libsundown.so.

. , , LD_LIBRARY_PATH?

libsundown.so , /usr/lib /usr/local/lib. make - , INSTALL README, , , - .

+6

Source: https://habr.com/ru/post/1535192/


All Articles