lager_transform未定义错误
rebar编译时报错:
D:\server\six>d:/tools/rebar/rebar.cmd compile
==> mysql (compile)
Compiling d:/server/six/deps/mysql/src/mysql_recv.erl failed:
d:/server/six/deps/mysql/src/mysql_recv.erl:none: undefined parse transform 'lager_transform'
d:/server/six/deps/mysql/src/mysql_recv.erl:12:
Warning: Non-UTF-8 character(s) detected, but no encoding declared.
Encode the file in UTF-8 or add "%% coding: latin-1" at the beginning of the file.
Retrying with latin-1 encoding.
ERROR: compile failed while processing d:/server/six/deps/mysql: rebar_abort
lager_transform已加入erl_opts.
将lager在deps列表中提到第一位可解决。
{erl_opts, [{parse_transform, lager_transform}]}.
%% lager must be the first to use lager_transform.
{deps, [{lager, ".*", {git, "https://github.com/basho/lager.git"}},
{mysql, ".*", {git, "https://github.com/dizzyd/erlang-mysql-driver.git"}} ...
rebar仅仅是按依赖项顺序编译。
也可以预先编译lager,然后再rebar compile.
参考:
http://stackoverflow.com/questions/20813513/configuring-lager-i-get-this-error-undefined-parse-transform-lager-transform