Problem:
Run the GSL (GNU Scientific Library) function library
Gcc erf. c-I/usr/local/include-L/usr/local/lib64-L/usr/local/lib-g-wall -- STD = gnu99-lgsl-lgslcblas-o m. O
Compile and run./m. o
Error while loading shared libraries: libgsl. so.0: cannot open shared object file: no such file or directory
Solution:
Under Shell
LDD m. o
Output:
~ /Test/C $ LDD m. o
Linux-vdso.so.1 => (0x00007fff3d5ff000)
Libgsl. so.0 => not found
Libgslcblas. so.0 => not found
Libc. so.6 =>/lib64/libc. so.6 (0x00007f7420c3b000)
/Lib64/ld-linux-x86-64.so.2 (0x00007f7420fdd000)
Libgsl and libgslcblas. So cannot be found
Sudo ldconfig
The role of ldconfig is: Configure dynamic linker Run Time Bindings.
Then run LDD m. o again
~ /Test/C $ LDD m. o
Linux-vdso.so.1 => (0x00007fff62bad000)
Libgsl. so.0 =>/usr/local/lib/libgsl. so.0 (0x00007f6968a01000)
Libgslcblas. so.0 =>/usr/local/lib/libgslcblas. so.0 (0x00007f69687ce000)
Libc. so.6 =>/lib64/libc. so.6 (0x00007f6968439000)
Libm. so.6 =>/lib64/libm. so.6 (0x00007f69681b5000)
Run successfully
Cause:
After installing GSL, the dynamic link library of GSL cannot be identified because it is not refreshed in time.