vuldan
January 30, 2021, 11:43pm
1
Try to run module with simple echo server from here https://github.com/yummybian/erlang-programming-exercises/blob/master/ch4/ex4_1.erl
Write:
Erlang/OTP 23 [erts-11.1.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Eshell V11.1.4 (abort with ^G)
1> c(ex4_1).
{error,non_existing}
Beam file not was created
Try run in online compiler https://www.tutorialspoint.com/compile_erlang_online.php
Write:
helloworld.erl:5: syntax error before: ‘)’
helloworld.erl:2: function start/0 undefined
How solve this problem?
The first error is Erlang not finding the file ex4_1.erl
. Verify that the file is in the right place and named correctly.
The online tool seems to have particular issue with spawn
- even this program gives the same kind of syntax error:
% hello world program
-module(helloworld).
-export([start/0]).
start() ->
spawn(fun() -> ok end).
result:
$erlc *.erl
helloworld.erl:6: syntax error before: ')'
helloworld.erl:3: function start/0 undefined
I couldn’t find any documentation on that site, but I could imagine an online REPL disabling spawn
to keep users from consuming all the server resources
vuldan
February 2, 2021, 5:33am
3
Thank you. Problem solved, but I don’t know why - its magically worked now. Maybe because i reinstalll erlang or reboot system.