简体   繁体   中英

Including wxwidgets in exrm build

How can I add the wxwidgets library to my Windows exrm build? Currently, when I run my exrm-built application on Windows or try to use :wx.new() , I receive a message:

** (UndefinedFunctionError) function :wx.new/0 is undefined (module :wx is not available)

I managed to solve my problem by adding a relx.config file to the rel directory in my project. Getting the syntax right was a little challenging, but I noticed that mix release created a temporary rel\\.files directory while it was running. In that directory is a generated version of relx.config that you can use for reference. Since the mix task takes a while to run, there is time to open that file and peek at its contents.

With an app named foo , the contents of the relx.config file was just one line:

{release,{foo,"0.0.1"},[{foo,"0.0.1"},elixir,iex,sasl,wx]}.

The only part I added was the ",wx".

I ran mix release --prod once again and then extracted the rel\\foo\\releases\\0.0.1\\foo.tar.gz file into a test directory. From that test directory, .\\bin\\foo console ran my application with all the GUI working as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM