With that form, you need to execute erl
the same directory as the module you are trying to compile. You can specify a file path when you use the c
function. This will create a .beam
file in your current directory:
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.1 (abort with ^G)
1> c("stackoverflow/passfun.erl").
{ok,passfun}
2> passfun:some_func().
hello