简体   繁体   中英

ldd library not found

I get the following error launching my program:

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

The point is the libnetcdf.so.6 is the old version of the library, I have deleted it and built the new one.

So when I try ldd I see:

libnetcdf.so.7 => /usr/local/lib/libnetcdf.so.7 (0x00007f70f8c4b000)

but also

libnetcdf.so.6 => not found

Why this old reference? What can I do to solve?

You will need to re-link your application to libnetcdf.so.7 so the application looks for that rather than .6

You may have a symbolic link that the linker will look at with no version number (libnetcdf.so) if this isn't present you may need to create it before re-linking:

ln -s libnetcdf.so.7 libnetcfd.so

If you can't re-link the application then you can create a symbolic link to make the application look at your newer library (although this could cause segmentation faults if the library versions aren't binary compatible) to point to the actual .so file:

ln -s libnetcfd.so.7 libnetcfd.so.6

This will cause the application to find the shared object it requires but isn't the ideal solution.

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