Pid2 = spawn(echo" /> Pid2 = spawn(echo" /> Pid2 = spawn(echo"/>

Erlang simple "spawn" gets undefined error in windows

43 Views Asked by At

I'm learning Erlang and I've written a simple module to test "spawn" function:

-module(concurrent).
-export([go/0, loop/0]).
 
go() ->
    Pid2 = spawn(echo, loop, []).

loop() -> 2. 

but when I run concurrent:go(). I get this error message:

=ERROR REPORT==== 10-Feb-2023::14:41:34.586000 === Error in process
<0.84.0> with exit value: {undef,[{echo,loop,[],[]}]}

I don't understand what I'm doing wrong.

1

There are 1 best solutions below

0
Wojtek Surowka On BEST ANSWER

You try to spawn a process running function loop from module echo. But you export function loop from module named concurrent and not echo.