user2617702
user2617702

Reputation: 51

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?

Upvotes: 0

Views: 8076

Answers (1)

Chris L
Chris L

Reputation: 2292

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.

Upvotes: 3

Related Questions