I installed Erlang 13B and tried to follow the tutorials.
Every time I get to c(tut)
, I get an error instead of (ok, tut)
, so it seems like the
For c(tut)
to work, there has to be a tut.erl
file in the current directory.
This is easy to accomplish if you start the Erlang interpreter from the command line, as is common on systems like Linux and OS X, but this isn't the usual pattern on Windows. When you start Erlang on Windows from the icon in the Start menu, the current working directory defaults to the location of werl.exe
, which isn't where your tut.erl
file is.
To make your command work as expected, you have to change your working directory to be the location of tut.erl
after starting the Erlang shell. If tut.erl
is on the Desktop, the command will be something like this on Vista or Windows 7:
cd("c:/Users/myname/Desktop").
(Yes, you have to use forward slashes. Backslashes are special in Erlang strings.)
On Windows XP and older, your Desktop folder is buried much deeper. It might be simpler to put werl.exe
in the system PATH
and use the command line on such systems.
It isn't necessary, but you might want to consider installing Cygwin. Its Bash shell will give you a more Linux or OS X like environment, which will help you work with other tutorials that are structured for those OSes.