Compiling Erlang code on Windows

前端 未结 6 832
夕颜
夕颜 2021-02-08 03:48

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

6条回答
  •  孤独总比滥情好
    2021-02-08 04:26

    You can also create an initialization file named .erlang under YourErlangInstallationPath\usr\

    the content of the file should look something like this;

    io:format("consulting .erlang in ~p~n" ,
    [element(2,file:get_cwd())]).
    %% Edit to the directory where you store your code
    c:cd("O:/Erlang.Umut").
    io:format("Now in:~p~n" , [element(2,file:get_cwd())]).
    

    it will automatically change the path to your working folder. (Obviously, my path is O:/Erlang.Umut, you need to replace it with yours.)

    No need to change folders every time you launch console. Console will be able to reach your erl files directly.

提交回复
热议问题