【发布时间】:2014-12-19 15:50:45
【问题描述】:
大家下午好,
我最近对 Erlang 和函数式编程产生了兴趣。我试图在不打开 Erlang shell 的情况下运行这个简单的 hello world 示例。我能够在 MACOSX (Yosemite) 中成功运行它,但我想改用我的 Fedora 20 VM。因此,在 Fedora (Linux)(甚至 Windows 7)中,尝试运行已编译的梁时出现以下错误:
{"init terminating in do_boot",{undef,[{heythere,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
这些是我用来运行文件的开关:
erl -noshell -start -s heythere -init -stop
我什至替换了“-s”开关并使用“-run”无济于事。我可以在 shell 内运行模块,但不能在 shell 之外运行。是不是我做错了什么?
代码:
-module(heythere).
-export([hello_world/0, this_function/0, both/0]).
hello_world() ->
io:fwrite("hello, world\n").
this_function() ->
io:fwrite("This is another function...ok~n").
both() ->
hello_world(),
this_function().
我尝试查看 erl_crash.dump,但它的长度超过 1000 多行,我无法确定它的正面或反面。 :-(
提前非常感谢你们。
【问题讨论】:
标签: linux functional-programming erlang