This not is not - strictly speaking - an Asterisk issue; but I present it here as it sometimes pops up with Asterisk installations, after compiling shared libraries (for example, OH323).

A typpical example is in fact an error like the one here below:

 []May  2 15:41:29 WARNING[-1218537120]: loader.c:242 ast_load_resource: cannot open shared object file: No such file or directory
May  2 15:41:29 WARNING[-1218537120]: loader.c:423 load_modules: Loading module failed!

Here Asterisk is complaining that even if the module chan_oh323 does exit and is being loaded, it cannot be completely loaded because of some missing shared libraries.

What is a shared library?

A shared library is a piece of compiled code that can be shared by more than one program on your system. This way, utility libraries need not be embedded in each and every executable that is on your disk. The cons are that if you copy a program and it does not find the exact libraries it needs in the designated system folders, it will simply refuse to run.

How do I find which shared libraries are required by a module?

The command ldd is your friend. It will report something like: NO-PLUGIN:(CODE marker=”3,4” :] root@vm lib# ldd /usr/lib/asterisk/modules/ => /lib/ (0x00bf2000) => not found => not found => /usr/lib/ (0x008fc000) => /lib/tls/ (0x009ff000) => /lib/ (0x00add000) => /lib/tls/ (0x00111000) => /lib/tls/ (0x0025c000) => /lib/ (0x0034b000) /lib/ => /lib/ (0x00b98000) [:CODE)

As you can see, some modules are missing and cannot be loaded.

How do I add the correct shared libraries?

If you compiled the packes yourself, chances are that the shared libraries you are looking for are present on your system, but in the wrong locations.

To understand if that is the case, simply run the locate command, like here below:

[root@vm lib]# locate

It is important that them files have the exact (long) names referenced by the module.

In this case you simply copy your library to /lib and run ldd again to see if it can be loaded.

Repeat as needed.