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

Abhishek Singh singhabhishek.bit@REDACTED
Thu Jan 7 16:50:52 CET 2016


I was able to overcome this error by copying macro statements from below
link:

https://github.com/couchbase/couchdb/blob/master/src/couchdb/priv/couch_ejson_compare/couch_ejson_compare.c#L486-L493

Not sure what exactly it does, would be useful if somebody could throw some
light on it.

On Thu, Jan 7, 2016 at 8:43 PM Sverker Eriksson <
sverker.eriksson@REDACTED> wrote:

>
>
> 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
>
>
> --
Thanks,

Abhishek Singh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160107/4ca0d394/attachment.htm>


More information about the erlang-questions mailing list