user2418929
user2418929

Reputation: 31

Trying to compile my first program in Erlang

I am getting compiler issue when trying to compile a simple test program on erlang. I have tried both on mac os x (lion) and windows 7 (64)

~module(tut).
~export([double/1]).

double (N) ->
N*2.

I have checked that the file is named correctly and the correct modules seem to be installed I am using the otp_win64_R16B on my windows machine. I get the following error on both platforms

16> c(tut).  
tut.erl:1: syntax error before: '~'
tut.erl:2: syntax error before: '~'
tut.erl:4: no module definition
tut.erl:4: Warning: function double/1 is unused

Can anyone help?

Upvotes: 2

Views: 1690

Answers (2)

BlackMamba
BlackMamba

Reputation: 10254

You should replace ~ with -. Please take a try.

Upvotes: 0

Greg
Greg

Reputation: 8340

Well, it should be: -module and -export, with the - not with ~.

Upvotes: 7

Related Questions