最近在做关于Erlang的项目,刚好把自己配置Erlang的开发环境(windows,erlang+editplus)写出来,供大家交流
1.下载Erlang安装包,安装在(C:/Program Files/erl5.7.1)
2.下载EditPlus(版本不限)
3.编写批处理文件(.bat)
erl -shell -s Cuscompile compile_debug %1 -s init stop
erl -shell -s Cuscompile compile_release %1 -s init stop
4.在Erlang中编译下面的代码Cuscompile.erl,生成Cuscompile.beam
-module(Cuscompile).
-export([compile_debug/1, compile_release/1]).
compile_debug(File) ->
begin
case compile:file(File, [verbose,report_errors,report_warnings, debug_info]) of
{ok, Reason} -> io:format("~p~n", [{ok, Reason}]);
Val -> io:format("~p~n", [Val])
end
end.
compile_release(File) ->
begin
case compile:file(File) of
{ok, Reason} -> io:format("~p~n", [{ok, Reason}]);
Val -> io:format("~p~n", [Val])
end
end.
注意:把Cuscompile.beam这个文件将来放在你要编译的同一目录下即可。