-module(gen_server_template).
%% gen_server_template
-behaviour(gen_server).
-export([start_link/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
init([]) -> {ok, State}.
handle_call(_Request, _From, State) -> {reply, Reply, State}.
handle_cast(_Msg, State) -> {noreply, State}.
handle_info(_Info, State) -> {noreply, State}.
terminate(_Reason, _State) -> ok.
code_change(_OldVsn, State, Extra) -> {ok, State}.
以上是erlang otp编程,的服务器端,我是照着书上敲的代码,刚接触erlang没几天,我编译时,提示我以下错误,求各位大神看看我该怎么修改???问题原因是什么???
gen_server_template.erl:11: undefined macro 'SERVER'
gen_server_template.erl:5: function start_link/0 undefined
gen_server_template.erl:13: variable 'State' is unbound
gen_server_template.erl:15: variable 'Reply' is unbound
gen_server_template.erl:19: Warning: variable 'Extra' is unused
error