erlang undefined function:wx_object.start/3

5q4ezhmt  于 12个月前  发布在  Erlang
关注(0)|答案(3)|浏览(90)

我试图在我的Mac 64 bit上安装ErLang,Capitan,我试图通过brew安装它,但当我尝试运行:observer.start时,我得到了这个错误:

** (UndefinedFunctionError) undefined function :wx_object.start/3 (module :wx_object is not available)
    :wx_object.start(:observer_wx, [], [])
    observer_wx.erl:72: :observer_wx.start/0

我也尝试使用erlang解决方案安装erLang otp 18.3,但我得到了同样的错误。
你知道吗?

编辑

如果我尝试直接从Erlang shell启动观察器:

^CiMac:~ Apple$ erl 
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.3  (abort with ^G)
1> observer:start().
** exception error: undefined function wx_object:start/3
     in function  observer_wx:start/0 (observer_wx.erl, line 72)

EDIT2

iMac:~ Apple$ brew info erlang
erlang: stable 18.3 (bottled), HEAD
Programming language for highly scalable real-time systems
https://www.erlang.org/
/usr/local/Cellar/erlang/18.3 (7,489 files, 273.8M)
  Poured from bottle on 2016-05-13 at 12:24:59
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/erlang.rb
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔
Required: openssl ✔
Recommended: wxmac ✔
Optional: fop ✘
==> Options
--with-dirty-schedulers
    Enable experimental dirty schedulers
--with-fop
    Build with fop support
--with-native-libs
    Enable native library compilation
--without-docs
    Do not install documentation
--without-hipe
    Disable building hipe; fails on various OS X systems
--without-wxmac
    Build without wxmac support
--HEAD
    Install HEAD version
==> Caveats
Man pages can be found in:
  /usr/local/opt/erlang/lib/erlang/man

Access them with `erl -man`, or add this directory to MANPATH.
iMac:~ Apple$ which erl
/opt/local/bin/erl

brew info的erl是:/usr/local/Cellar/erlang/18.3但是,erl是:/opt/local/bin/erl,指向/opt/local/lib/erlang/bin/erl
如果我开始/usr/local/Cellar/erlang/18.3/bin/erl观察员会工作!
所以,我用鼠标删除了别名,然后我:

sudo ln -s /usr/local/Cellar/erlang/18.3/lib/erlang/bin/erl /opt/local/bin/erl

但我不确定X1 M2 N1 X是如何创建的。无论如何,它现在工作了。

flmtquvp

flmtquvp1#

从语法上看,你似乎在使用Elixir:-)
无论如何,一个可能的答案是您需要使用WxWidgets构建Erlang,WxWidgets是观察者使用的GUI工具包。
如果我看一下Erlang(http://brewformulas.org/Erlang)的自制程序公式,它显示它将安装“Wxmac”依赖项,所以它应该引入WxWidgets...
如果您尝试直接从Erlang shell启动观察者,会发生什么?
1> observer:start().
(我已经用MacPorts安装了它,它开箱即用)。

编辑

Erlang似乎没有WxWidget。你可以尝试brew info erlang,它会显示你安装的版本以及wxmac依赖是否安装。
你真的确定你开始正确的erl吗?brew安装的那个?(控制台中的“which erl“是否打印预期的路径?)

ewm0tg9j

ewm0tg9j2#

在许多系统上,Erlang和wx默认不受支持。它可以通过编译选项启用。有时候会有一个单独的包,它已经被wx支持编译了,例如。FreeBSD上的erlang-wx
快速的Google搜索显示了这篇示例文章,其中提供了有关启用recompiling Erlang on Mac with wx的一些信息。

gcmastyq

gcmastyq3#

如果您在Elixir 1.15或更高版本上运行混合项目时遇到此问题,由于代码路径修剪,您需要将:observer:wx添加到mix.exs中的extra_applications列表中。

相关问题