金庆的专栏

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  423 随笔 :: 0 文章 :: 454 评论 :: 0 Trackbacks
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
posted on 2015-03-31 16:45 金庆 阅读(1654) 评论(0)  编辑 收藏 引用 所属分类: 7. Erlang

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理