Erlang:如何在rebar3版本中包含wx库



如何将erlang (/lib/erlang/lib/wx-2.1.2)附带的wx库包含在rebar3版本中?我不明白在哪里复制这些文件以及如何在我的钢筋中声明它们。配置文件。

我在我的应用程序中使用以下代码:

-module(main_window).
-include_lib("wx/include/wx.hrl").
-include("state_records.hrl").
-export([start/0]).
start() ->
Wx = wx:new(),
State = wx:batch(fun() -> create_window(Wx) end),
wxWindow:show(State#state.frame),
loop(State),
wx:destroy(),
ok.
...

启动我的应用程序运行rebar3 compile,然后rebar3 shell工作。但是当我使用rebar3 release时,我得到以下输出:

===> There are missing function calls in the release.
===> Make sure all applications needed at runtime are included in the release.
===> main_window:create_window/1 calls undefined function wxBoxSizer:new/1
===> main_window:create_window/1 calls undefined function wxFrame:connect/2
===> main_window:create_window/1 calls undefined function wxFrame:createStatusBar/2
===> main_window:create_window/1 calls undefined function wxFrame:new/4
===> main_window:create_window/1 calls undefined function wxFrame:setIcon/2
===> main_window:create_window/1 calls undefined function wxFrame:setMenuBar/2
===> main_window:create_window/1 calls undefined function wxFrame:setStatusText/3
===> main_window:create_window/1 calls undefined function wxIcon:new/2
...

根据这里的文档,relx将添加到版本中的应用程序应该作为列表提到,请参阅

运行rebar3 release将构建版本,并提供一个脚本用于在_build//rel//bin/下启动节点。

& lt; release_name>必须是一个原子,对于要包含在发布中的应用程序列表中的每个应用程序都是一样的。

{relx, [{release, {<release name>, <vsn>},
[<app>]},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]}.

最新更新