未在Erlang中加载外部模块
我是新来的。我正在尝试通过加载托管在git上的库,并且能够成功编译。现在,当我尝试运行我的Erlang应用程序调用实际指向库模块函数的main函数时,它在shell未在Erlang中加载外部模块,erlang,rebar3,Erlang,Rebar3,我是新来的。我正在尝试通过加载托管在git上的库,并且能够成功编译。现在,当我尝试运行我的Erlang应用程序调用实际指向库模块函数的main函数时,它在shell中抛出一个错误“模块无法加载” 我尝试了code.get_path(),但是我的模块没有列出。所以我在这里感到困惑。有人能帮我吗 ** Generic server <0.80.0> terminating ** Last message in was {'DOWN',#Ref<0.1535589919.2
中抛出一个错误“模块无法加载”
我尝试了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)
注意:我正在使用来编写代码
看起来您正在以不正确的方式共享
smpp34pdu
。它应该作为smpp34的依赖项,但由于某些原因它不是。最简单的解决方案是将smpp34pdu
添加到reber.config
中的DEP中
也是有七年历史的库,您可能会认为rebar3和/或当前版本的Erlang(如果您正在使用)存在一些不兼容问题。我建议将这两个存储库克隆到您自己的GithHub帐户,并修复/解决您遇到的所有问题。您可以将配置升级到rebar3,并将
smpp34pdu
作为依赖项添加到smpp34
您是否可以验证是否在中编译了smpp34pdu.beam
?您说“模块未列出”,但code:get_path
仅列出目录,那么,是否有\u build/default/lib/smpp34/bin/
列出了smpp34pdu.beam
在\u build/default/lib/smpp34pdu/ebin
中编译,这里smpp34pdu
是我的Git远程库。你能编辑你的问题并添加code:get\u path
的返回值吗?你说smpp34pdu.beam在\u build/default/lib/smpp34
和\u build/default/lib/smpp34pdu
也smpp34pdu
中没有显示code:get_path()
我已经在smpp34
的rebar.config
中添加了smpp34pdu
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",
[...]|...]