Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libarb.so: cannot open shared object file: No such file or directory

I installed arb in Ubuntu using

./configure
make
sudo make install 

and tried to run this code:

#include <arb.h>

int main()
{
    arb_t x;
    arb_init(x);
    arb_const_pi(x, 50 * 3.33);
    arb_printn(x, 50, 0); printf("\n");
    printf("Computed with arb-%s\n", arb_version);
    arb_clear(x);
}

with -larb libarary. But in terminal I got this error:

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

How can I solve this problem?

I searched and there is a libarb.so in /usr/local/lib.

like image 771
Minimus Heximus Avatar asked Nov 14 '25 12:11

Minimus Heximus


2 Answers

Check and verify these steps

  1. check library is present, use below command

find / -name "libarb.so"

  1. compile your program with -L option, example below
 gcc program.c -L <path to library> -larb
  1. export Library path before running if required. example below
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path to library>

in most cases ( considering all access permissions are set properly ) the above steps should resolve linking problems.

like image 97
asio_guy Avatar answered Nov 17 '25 08:11

asio_guy


Use ldconfig command to add the library at the linker cache.

To do so, add the directory that your library is stored at the /etc/ld.so.conf and then execute ldconfig as root.

like image 24
Manos Avatar answered Nov 17 '25 10:11

Manos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!