未定义函数:wx_object.start / 3 [英] undefined function :wx_object.start/3
问题描述
我尝试在Mac 64位Capitan Mac上安装ErLang,但尝试通过brew安装它,但是当我尝试运行:observer.start时,出现此错误:
**(UndefinedFunctionError)未定义函数:wx_object.start / 3(模块:wx_object不可用)
:wx_object.start(:observer_wx,[] ,[])
rator_wx.erl:72::observer_wx.start / 0
I也尝试使用erlang解决方案安装erLang otp 18.3,但我遇到了同样的错误。
任何想法吗?
编辑
如果我尝试直接从Erlang Shell启动观察器:
^ CiMac:〜Apple $ erl
Erlang / OTP 18 [erts-7.3] [source] [64位] [smp:4:4] [async-threads :10] [hipe] [kernel-poll:false]
Eshell V7.3(用^ G中止)
1>观察者:start()。
**异常错误:未定义函数wx_object:start / 3
在函数observer_wx:start / 0中(observer_wx.erl,第72行)
EDIT2
iMac:〜Apple $ brew info erlang
erlang:稳定的18.3(瓶装),HEAD
高度可扩展的实时系统的编程语言
https://www.erlang.org/
/ usr /local/Cellar/erlang/18.3(7,489 file,273.8M)
2016年13月13日从12:24:59
从瓶子倒出从:https://github.com/Homebrew/ homebrew-core / blob / master / Formula / erlang.rb
==>依赖项
构建:autoconf✔,automake✔,libtool✔
必需:openssl✔
推荐:wxmac✔
可选:fop✘
==>选项
--with-dirty-schedulers
启用实验性脏调度程序
--with-fop
带有fop支持的构建
--with-native-libs
启用本机库编译
--without-docs
不要安装文档
--without-hipe
禁用构建环境;在各种OS X系统上失败
-不带wxmac
不支持wxmac的构建
--HEAD
安装HEAD版本
==>注意事项
手册页位于:
/ usr / local / opt / erlang / lib / erlang / man
用`erl -man`访问或添加目录到MANPATH。
iMac:〜Apple $ erl
/ opt / local / bin / erl
err at brew info是:
/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
但是我不确定 / opt / local / lib / erlang / bin / erl
它是如何创建的..
给出看起来像您在使用Elixir的语法:-)
无论如何,一个可能的答案是,您需要使用WxWidgets构建的Erlang,这是观察者使用的GUI工具包。
如果我查看Erlang的自制程序公式( http://brewformulas.org/Erlang ),它表明了它将安装 Wxmac依赖项,因此它应该引入WxWidgets ...
如果尝试按如下所示直接从Erlang Shell启动观察器,会发生什么? / p>
1>观察者:start()。
(我已经在MacPorts上安装了它,并且可以直接使用)。
编辑
Erlang看起来确实没有WxWidgets。您可以尝试使用 brew info erlang
,它将显示您安装了哪个版本,以及是否安装了 wxmac
依赖项。
您确定实际上是在启动正确的erl吗?一个由brew安装? (控制台中的 which erl
打印预期路径吗?)
I have tried to install ErLang on my Mac 64bit, Capitan, I've tried to install it via brew, but when I try to run :observer.start I get this error:
** (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
I also tried to install erLang otp 18.3 using erlang solutions, but I got the same error.
Any idea?
EDIT
If I try to start the observer directly from the 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
erl at brew info is:
/usr/local/Cellar/erlang/18.3
but, which erl is:
/opt/local/bin/erl
which points to /opt/local/lib/erlang/bin/erl
if I started /usr/local/Cellar/erlang/18.3/bin/erl
observer will work!
so, I deleted the alias by mouse and I:
sudo ln -s /usr/local/Cellar/erlang/18.3/lib/erlang/bin/erl /opt/local/bin/erl
but I am not sure about /opt/local/lib/erlang/bin/erl
how it was created..
any way, it works now..
Given the syntax it looks like you are using Elixir :-)
Anyway, one possible answer is that you need Erlang built with WxWidgets, which is the GUI toolkit used by the observer.
If I look at the homebrew formula for Erlang (http://brewformulas.org/Erlang), it shows that it will install the "Wxmac" dependency, so it should bring in WxWidgets...
What happens if you try to start the observer directly from the Erlang shell as follows?
1> observer:start().
(I have installed it with MacPorts and it works out of the box).
EDIT
It really looks like that Erlang doesn't have WxWidgets. You can try brew info erlang
, it will show you which version is installed and wether the wxmac
dependency is installed or not.
Are you sure actually you are starting the right erl? The one installed by brew? (does "which erl
" in the console print the expected path?)
这篇关于未定义函数:wx_object.start / 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!