erl_nif.h not found
Asked Answered
C

1

7

I try to use erlang nif,

I made:

#include <erl_nif.h>

But get error:

fatal error: erl_nif.h: No such file or directory

Where can i find it? I have installed erlang R14B (erts-5.8.1)

OS Arch linux.

Thank you.

Crutchfield answered 20/8, 2011 at 15:8 Comment(0)
C
12

Compile with -I/usr/lib/erlang/erts-5.8.1/include, if that's where erl_nif.h is.

Cotoneaster answered 20/8, 2011 at 15:14 Comment(3)
I like to add a variables to my ~/.bash_profile. For my installation (made by brew) I've added: export ERLHOME=/usr/local/Cellar/erlang/17.5 and export ERLINCL=$ERLHOME/lib/erlang/usr/include. In this way I can just specify: -I$ERLINCL.Snatch
Set C_INCLUDE_PATH , see gcc.gnu.org/onlinedocs/cpp/Environment-Variables.htmlCotoneaster
Thanks, still valid! On MBP M1 you can find the path with brew info erlang which in my case was /opt/homebrew/Cellar/erlang/26.2.5/lib/erlang/erts-14.2.5/include. Sadly building is another matter on ARM which seems a lot harder to fix..Freiburg

© 2022 - 2024 — McMap. All rights reserved.