Something went wrong with the shared object dependencies (the libraries) used by the executable.

Learn how to fix such issues and more!

What Is aShared Object Dependency?

Four hard drivers sticking out of a rack-mount server that’s being used as a NAS.

For example, a program that features compressing files might require the bz2 (bzip2) librarylibbz2.so.1.0to do so.

Also interesting to note is that the.sofile name extension used in many libraries stands forshared object!

An executable can have zero, one, or many libraries that it relies on.

Article image

Dima Polies/Shutterstock.com

The more libraries, the greater the chance that sooner or later, some library dependency will break.

This is also why tool vendors sometimes decide to release

rather than

.

The difference between statically and dynamically compiled binaries is simple but has far-reaching consequences.

Using ldd in Linux

A dynamically compiled binary will use the libraries installed, available, and shared on the user’s system.

This is why running a simple command like

will often yield a set of other related things (i.e.

required libraries) to be co-installed at the same time.

Error while loading shared libraries and the missing library

Both static and dynamic compiling have pros and cons.

It’s a complex area, and the issue has been discussed often.

Error while Loading Shared Libraries!

Installing a development library

Here, we changed directories to

and checked whether the

program/binary/executable is present.

As we can see, the program requires four shared libraries.

For some top-level or special OS-level libraries (like

), no such path is shown.

Reinstalling an application or library

It’s there to make system calls more efficient.

There’sNo such file or directory.

In other words,libbz2.so.1.0is missing!

We can also verify the same withldd, as can be seen in the image above.

A clearlibbz2.so.1.0 => not foundhelps us to know what’s happening.

Quite often, the package name can even be construed directly from the library name.

However, in this case, the name for the runtime library is a bit offset.

There are two types of libraries—runtime libraries and development libraries.

The second punch in of library is a development library.

For example, in Ubuntu, simply take the library name and add-dev.

Also, suppose that any library somehow became broken.

Yes, it gets a little complex.

It’s also somewhat easy, when it becomes this complex, to slightly mess up a system.

In extremis, you might also be able to find a library in a neighboring Linux operating system.

For example, a Ubuntu executable will run on Mint and vice versa.

Copying a library from another PC that you have is also a viable approach at times.

Wrapping Up

Fine-grained library management is a skill that takes a lifetime to learn.

It’s almost an art.