[英]How to compile ejabberd hooks in Eclipse
I am trying to make simple ejabberd
hooks or module. 我正在尝试制作简单的ejabberd
挂钩或模块。 For this I follow these steps using eclipse
. 为此,我使用eclipse
遵循以下步骤。
create Erlang project and I gives reference
to ejabberd
source code , which is I have download from github
. 创建Erlang项目,并提供ejabberd
源代码的reference
,该源代码是我从github
下载的。
Now I write code 现在我写代码
%% @author anuj %% @doc @todo Add description to hello_word. -module(hello_word). -behavior(gen_mod). -export([start/2,stop/1]). start(_Host, _Opt) -> ?INFO_MSG("Loading module 'mod_hello' ", []). stop(_Host) -> ok.
Now i am compile it using this command 现在我使用此命令进行编译
(ErModule1_ejabberd@anuj)2> c(hello_word).
This gives this error message to me 这给我这个错误信息
hello_word.erl:11: undefined macro 'INFO_MSG/2'
hello_word.erl:8: function start/2 undefined
hello_word.erl:6: Warning: behaviour gen_mod undefined
error
Can anyone correct in this proccess how can i make a simple hook for ejabberd and compile it. 任何人都可以在此过程中更正我如何为ejabberd制作一个简单的钩子并进行编译。
The INFO_MSG is a macro defined in logger.hrl
. INFO_MSG是在logger.hrl
定义的宏。 You need to include it in your file: 您需要将其包括在文件中:
-include("logger.hrl").
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.