[erlang-questions] NIF Query

Roger Lipscombe <>
Sat Sep 2 21:17:19 CEST 2017


On 2 September 2017 at 00:13, John Duffy <> wrote:
> 1.)  if my module name doesn't match the filename in the call to
> erlang:load_nif("filename", 0) I get a compile error. This is not as per the
> example in the documentation, i.e. -module(complex6) &
> erlang:load_nif("complex6_nif, 0).

I don't see how you'd get a *compile* error. Could you clarify?

I *have* noticed that the name of the calling module (i.e. the .erl
file) must match the name of the NIF as provided in the first argument
to ERL_NIF_INIT. That doesn't appear to be documented anywhere. Also
note that Erlang will implicitly add the ".so" extension when you call
'erlang:load_nif'.


More information about the erlang-questions mailing list