Erlang:如何将WX库纳入Rebar3版本

发布于 2025-02-12 19:08:32 字数 1409 浏览 1 评论 0原文

我如何在我的rebar3版本中包括Erlang(/lib/erlang/lib/wx-2.1.2)的WX库,这些库是eRlang(/lib/erlang/lib/wx-2.1.2)?我不明白在哪里复制这些文件以及如何在我的rebar.config文件中声明它们。

我在我的应用中使用此代码:

-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 works启动我的应用程序。但是,当我使用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
...

How do I include the wx libraries, that are shipped with erlang (/lib/erlang/lib/wx-2.1.2), in my rebar3 release? I do not understand where to copy those files and how to declare them in my rebar.config file.

I use this code in my app:

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

...

Starting my app by running rebar3 compile and then rebar3 shell works. But when I use rebar3 release I get the following output:

===> 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
...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凶凌 2025-02-19 19:08:32

根据文档在这里 relx将添加到发行中的应用; app>。

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

< Release_name>必须是一个原子,适用于发行版中的应用程序列表中的每个原子。

{relx, [{release, {<release name>, <vsn>},
     [<app>]},

    {dev_mode, true},
    {include_erts, false},

    {extended_start_script, true}]}.

According to the documentation here applications that relx will add into release should be mentioned as a list see <app>.

Running rebar3 release will build the release and provide a script for starting a node under _build//rel//bin/.

<release_name> must be an atom, same for each in the list of applications to include in the release.

{relx, [{release, {<release name>, <vsn>},
     [<app>]},

    {dev_mode, true},
    {include_erts, false},

    {extended_start_script, true}]}.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文