0

我是Erlang的新手。我正在尝试通过rebar3加载托管在 git 上的库并能够成功编译。现在,当我尝试运行我的 Erlang 应用程序调用实际上指向库模块函数的 main 函数时,它会在 shell 中引发错误'module could not be loaded'

我试过code.get_path()了,但我的模块没有列出。所以我在这里很困惑。有谁可以帮我离开这里吗 ?

    ** Generic server <0.80.0> terminating 
** Last message in was {'DOWN',#Ref<0.1535589919.2261778436.90425>,process,
                               <0.79.0>,normal}
** When Server state == {st_tcprx,<0.79.0>,
                                  #Ref<0.1535589919.2261778436.90425>,
                                  #Port<0.612>,<0.79.0>,<<>>,true,undefined}
** Reason for termination == 
** {'module could not be loaded',
       [{smpp34pdu,pack,[0,2147483647,{unbind}],[]},
        {smpp34_tcprx,terminate,2,
            [{file,
                 "/home/antarix/IdeaProjects/smpp34/_build/default/lib/smpp34/src/mod/smpp34_tcprx.erl"},
             {line,69}]},
        {gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,648}]},
        {gen_server,terminate,10,[{file,"gen_server.erl"},{line,833}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
** exception error: no match of right hand side value 
                    {'EXIT',
                        {{undef,
                             [{smpp34pdu,pack,
                                  [0,1,
                                   {bind_transceiver,"simple","simple123",[],
                                       52,0,0,[]}],
                                  []},
                              {smpp34_tx,handle_call,3,
                                  [{file,
                                       "/home/antarix/IdeaProjects/smpp34/_build/default/lib/smpp34/src/mod/smpp34_tx.erl"},
                                   {line,54}]},
                              {gen_server,try_handle_call,4,
                                  [{file,"gen_server.erl"},{line,636}]},
                              {gen_server,handle_msg,6,
                                  [{file,"gen_server.erl"},{line,665}]},
                              {proc_lib,init_p_do_apply,3,
                                  [{file,"proc_lib.erl"},{line,247}]}]},
                         {gen_server,call,
                             [<0.77.0>,
                              {send,0,
                                  {bind_transceiver,"simple","simple123",[],
                                      52,0,0,[]}}]}}}
     in function  smpp34module:start/0 (/home/antarix/IdeaProjects/smpp34/_build/default/lib/smpp34/src/smpp34module.erl, line 43)

这是我的code:get_path()输出

    code:get_path().
["/home/antarix/IdeaProjects/smpp34",
 "/home/antarix/IdeaProjects/smpp34/_build/default/lib/smpp34/ebin",
 ".","/usr/lib/erlang/lib/kernel-5.3.1/ebin",
 "/usr/lib/erlang/lib/stdlib-3.4.1/ebin",
 "/usr/lib/erlang/lib/xmerl-1.3.15/ebin",
 "/usr/lib/erlang/lib/wx-1.8.1/ebin",
 "/usr/lib/erlang/lib/tools-2.10.1/ebin",
 "/usr/lib/erlang/lib/syntax_tools-2.1.2/ebin",
 "/usr/lib/erlang/lib/ssl-8.2/ebin",
 "/usr/lib/erlang/lib/ssh-4.5.1/ebin",
 "/usr/lib/erlang/lib/snmp-5.2.6/ebin",
 "/usr/lib/erlang/lib/sasl-3.0.4/ebin",
 "/usr/lib/erlang/lib/runtime_tools-1.12.1/ebin",
 "/usr/lib/erlang/lib/reltool-0.7.4/ebin",
 "/usr/lib/erlang/lib/public_key-1.4.1/ebin",
 "/usr/lib/erlang/lib/parsetools-2.1.5/ebin",
 "/usr/lib/erlang/lib/otp_mibs-1.1.1/ebin",
 "/usr/lib/erlang/lib/os_mon-2.4.2/ebin",
 "/usr/lib/erlang/lib/orber-3.8.3/ebin",
 "/usr/lib/erlang/lib/odbc-2.12/ebin",
 "/usr/lib/erlang/lib/observer-2.4/ebin",
 "/usr/lib/erlang/lib/mnesia-4.15/ebin",
 "/usr/lib/erlang/lib/megaco-3.18.2/ebin",
 "/usr/lib/erlang/lib/jinterface-1.8/ebin",
 "/usr/lib/erlang/lib/inets-6.4/ebin",
 "/usr/lib/erlang/lib/ic-4.4.2/ebin",
 "/usr/lib/erlang/lib/hipe-3.16/ebin",
 [...]|...]

注意:我正在使用Intellij编写我的代码

4

1 回答 1

1

看起来你正在smpp34pdu以不正确的方式汇集。它应该依赖于smpp34,但由于某种原因它不是。最简单smpp34pdu的解决方案是在reber.config.

smpp34也是 7 年历史的库,您可能会预料到 rebar3 和/或当前版本的 Erlang(如果您正在使用)会出现一些不兼容问题。我建议将两个存储库克隆到您自己的 GithHub 帐户并修复/解决您遇到的所有问题。您可以将配置升级到 rebar3,并将smpp34pdu依赖项添加到smpp34.

于 2017-11-20T11:19:55.103 回答