如何在Eclipse中编译ejabberd钩子

时间:2015-09-28 07:39:36

标签: erlang ejabberd

我正在尝试制作简单的insert into FactTable (...) select distinct da.ID_Date as [ID_Date] , sc.Pk_Scenario as [ID_Scenario], co.Pk_Consolidation as [ID_Consolidation], br.PK_ShareBranch as [Id_Branch], ka.PK_Cost as [ID_CostCategory], cc.Pk_CostCenter as [ID_CostCenter], isnull(case ka.AccountType when 'c' then -1*cast(replace (amount,',','.') as decimal(18,2)) when 'r' then 1*cast(replace (amount,',','.') as decimal(18,2)) when 's' then cast(replace (amount,',','.') as decimal(18,2)) end, 0) as Amount, isnull(case ka.AccountType when 'c' then -1*cast(replace (amount,',','.') as decimal(18,2)) when 'r' then 1*cast(replace (amount,',','.') as decimal(18,2)) when 's' then cast(replace (amount,',','.') as decimal(18,2)) end, 0) as SharedAmount, cy.Pk_Currency as ID_Currency from [dbo].[TempCdbSap] cdb inner join DimBranchShare br on br.[Branch No] = cdb.branch inner join DimDate da on da.MonthName = cdb.[Month] and da.Year = cdb.[year] inner join DimCostCenter cc on cc.CostCenterName = cdb.CostCenter inner join DimScenario sc on sc.ScenarioTypeDEU = cdb.Scenario inner join DimConsolidation co on co.ConsolidationType = cdb.Consolidation inner join DimCostCategory ka on ka.AccountNo = cdb.CostCategorySAP inner join DimCurrency cy on cy.CurrencyCode = cdb.Currency where da.ID_Date >= year(br.RowStartDate) * 100 + month(br.RowStartDate) and da.ID_Date < year(br.RowEndDate) * 100 + month(br.RowEndDate) 挂钩或模块。为此,我使用ejabberd

执行以下步骤
  1. 创建Erlang项目,我将eclipse提供给reference源代码,我已从ejabberd下载。

  2. 现在我写代码

    github
  3. 现在我使用此命令编译

    %% @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.
    

    这会向我显示此错误消息

    (ErModule1_ejabberd@anuj)2> c(hello_word).
    

    任何人都可以纠正这个过程如何为ejabberd创建一个简单的钩子并编译它。

1 个答案:

答案 0 :(得分:1)

INFO_MSG是logger.hrl中定义的宏。您需要将其包含在您的文件中:

-include("logger.hrl").