0

I have built a ejabberd module in intelliJ using rebar to compile and I am getting the error "undefined parse transform 'lager_transform'"

rebar.config:

{erl_opts, [nowarn_deprecated_function,
{d, 'LAGER', true},
{d, 'NO_EXT_LIB'},
{i, ["c:/Program Files/ejabberd-15.11/bin"]},
{i, ["c:/Program Files/ejabberd-15.11/lib/ejabberd-15.11/include"]}]}.

I added these lines to the config file after checking responses on this site:

{deps, [{lager, ".", {git, "https://github.com/basho/lager", {tag, "3.0.2"}}},
{p1_utils, ".", {git, "https://github.com/processone/p1_utils", {tag, "1.0.3"}}},

I then proceed to try "rebar get-deps" but this fail with:

Pulling lager from {git,"https://github.com/basho/lager",{tag,"3.0.2"}}
ERROR: Rebar requires version {1,5} or higher of git to process {git,
"https://github.com/basho/lager",{tag,"3.0.2"}}
ERROR: 'get-deps' failed while processing C:/devxmpp/testMe: rebar_abort

So I proceed and downloaded git 2.7.x and still the same error. It is not seeing the new version.

Regards, Will

Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44
WXM1967
  • 137
  • 1
  • 7
  • Possible duplicate of [ejabberd and Erlang installation with lager\_transform undefined](http://stackoverflow.com/questions/35144794/ejabberd-and-erlang-installation-with-lager-transform-undefined) – Mickaël Rémond Feb 03 '16 at 07:46

1 Answers1

0

This is a duplicate of this question: ejabberd and Erlang installation with lager_transform undefined

You need to compile ejabberd as described in ejabberd documentation, with configure and make. rebar alone is not enough to set some initial define values for macro and will result in some part of the code being incorrectly defined / compiled.

Community
  • 1
  • 1
Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44
  • Sorry about the duplicate, but I did not see that one. That one was added a few hours before me. Why when I use erlc like this it works C:\Program Files\ejabberd-15.11\bin>erlc -v -DLAGER=true -DNO_EXT_LIB -I "c:/Program Files/ejabberd-15.11/lib/ejabberd-15.11/include" -o C:\devxmpp\prototype\mod_http_offline\src\ C:\devxmpp\prototype\mod_http_offline\src\mod_http_offline.erl – WXM1967 Feb 03 '16 at 14:37
  • Why don't you use configure and makefile ? That's how it is intended to be used. Put your module along with other ejabberd source file and build ejabberd the documented way. – Mickaël Rémond Feb 03 '16 at 14:44
  • I will try this on my windows box and let you know. – WXM1967 Feb 04 '16 at 02:13
  • I am not even sure you can build ejabberd on Windows, as there is native C code. You should use ProcessOne installer for Windows: https://www.process-one.net/en/ejabberd/downloads/. Then if you want to install contrib modules, either from ejabberd-contribs or from local code, you can use `ejabberdctl module_install` as shown here: https://blog.process-one.net/easy-installer-and-structure-for-ejabberd-contributed-modules/ – Mickaël Rémond Feb 04 '16 at 07:40
  • I am having fit just trying to locate some of the requirement to setup the compilation tools for windows....I am not interested in developing on unix right now. I will be using FreeBSD for server activities but not for development....I am trying none the less. – WXM1967 Feb 05 '16 at 04:27
  • The toolchain is not done for Windows. You will have to write / test it on your own. That said, using the binary installer and rebuilding only the Erlang code is probably easier. – Mickaël Rémond Feb 05 '16 at 07:36