[erlang-questions] Error from on_load function of NIF module

Sverker Eriksson sverker.eriksson@REDACTED
Thu Jan 7 16:13:12 CET 2016



On 01/06/2016 06:55 AM, Abhishek Singh wrote:
> Hi,
>
> I’m trying to get NIF implementation of unicode collation integrated into a database. Erlang module trying to load NIF: https://gist.github.com/abhi-bit/3aea4ff78ffb52820260
>
> During on_load function call, I’m seeing below error:
>
> The on_load function for module merger returned {error, {bad_lib, "Failed to find library init function: 'dlsym(0x7fa288718b30, _nif_init): symbol not found'”}}
>
> Any suggestion why that could be happening here? NIF C code lives under https://github.com/abhi-bit/merger for reference.
>
> /Abhi
> 	
>

This error means that the library .so file succeeded to load
but it did not contain a "nif_init" or "_nif_init" function
that is created by the ERL_NIF_INIT macro.

Use nm command to inspect symbols in your .so file.

nm merger.so | grep nif_init             # anything called nif_init ?

nm merger.so | grep merger_nif     # anything from merger.c ?


/Sverker, Erlang/OTP





More information about the erlang-questions mailing list