I start a process as follows
start() ->
register (dist_erlang, spawn(?MODULE, loop, [])),
ok.
But get the following error when trying to run start().
Error in process <0.62.0> with exit value: {undef,[{dist_erlang,loop,[]}]}
The module is called dist_erlang.
What am I doing wrong?
Thanks
Based on your previous question, your
loopfunction takes one parameter, not none. Erlang is looking forloop/0but can’t find it because your function isloop/1.The third parameter to
spawn/3is a list of parameters to pass to your function, and in the case you’ve shown the list is empty. Try:In this case, the third parameter is a list that contains one element (an empty list).