6

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.

Hynek -Pichi- Vychodil
  • 26,174
  • 5
  • 52
  • 73
0xAX
  • 20,957
  • 26
  • 117
  • 206

1 Answers1

11

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

Bertrand Marron
  • 21,501
  • 8
  • 58
  • 94
  • 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`. – gsscoder May 26 '15 at 09:22
  • Set `C_INCLUDE_PATH `, see https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html – Bertrand Marron May 26 '15 at 15:57