Jean
Jean

Reputation: 731

Erlang hello world problem?

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

    -module(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> 

Upvotes: 1

Views: 1841

Answers (2)

Cardoso
Cardoso

Reputation: 21

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.

Upvotes: 2

aztek
aztek

Reputation: 1431

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.

Upvotes: 3

Related Questions