开发者

Erlang hello world problem?

开发者 https://www.devze.com 2023-03-17 17:14 出处:网络
I can\'t understand why this doesn\'t work: -mo开发者_开发问答dule(hello). -export([hello_world/0]).

I can't understand why this doesn't work:

    -mo开发者_开发问答dule(hello).
    -export([hello_world/0]).

    hello_world() -> io:fwrite("hello, world\n").

(hello_world@PC)8> hello:hello_world().
** exception error: undefined function hello:hello_world/0
(hello_world@PC)9> 


Have you compiled your source code? Type c(hello). in Eshell (assuming that hello.erl is the name of the source file) before calling the function.


The way to fix that:

Go to: Run configurations
--Erlang
Select tab:
--Environment
then
--Select
check
-- Path
Apply and run.

Now you'll be good to go.

0

精彩评论

暂无评论...
验证码 换一张
取 消