简体   繁体   中英

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 .

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM