I’ve been studying elixir for the past month and I’m really enjoying it. I guess this is just a way of saying I’m fairly new to the language.
My problem happens when I open up an iex session and issue a :observer.start. This crashes the Erlang VM and I get this pretty scary error (this is just the first line of the error):
objc[48474]: Class wxNSAppController is implemented in both /usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_osx_cocoau_core-3.0.0.5.0.dylib (0x1b029c50) and /usr/local/opt/wxmac/lib/libwx_osx_cocoau_core-3.0.dylib (0x1a9a1c50). One of the two will be used. Which one is undefined.
As you can see, I’ve installed elixir and its dependencies via HomeBrew. Here’s the version of Elixir I’m running on my Mac.
I’ve asked a friend of mine to try the same thing on his machine, however running on the latest Catalina version, and things worked just fine. I’m assuming this is a MacOS problem, but I’m not quite sure yet.
I’d really appreciate any help on how to fix this issue. If I miss any info, please let me know.
It’s basically editing one file with a handful of changes, so brew installs the recent development version of wxwidgets. After that you can build erlang however you want (not sure if rebuilding is required however).
$ brew info erlang
erlang: stable 23.2.1 (bottled), HEAD
Programming language for highly scalable real-time systems
https://www.erlang.org/
/usr/local/Cellar/erlang/23.2.1 (7,978 files, 460.7MB) *
Poured from bottle on 2021-01-15 at 11:31:21
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/erlang.rb
License: Apache-2.0
==> Dependencies
Build: autoconf ✔, automake ✘, libtool ✘
Required: openssl@1.1 ✔, wxmac ✔
==> Options
--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.
==> Analytics
install: 30,248 (30 days), 96,829 (90 days), 358,251 (365 days)
install-on-request: 14,875 (30 days), 43,588 (90 days), 117,420 (365 days)
build-error: 0 (30 days)
I can see the wxmac package was installed as a dependency when I erlang was installed. Are you running on the same version of OS as me? That’s strange.
The only difference I can see between both you plus @albiere and my setup is that I have both automake and autoconf. Try installing them (both install through brew install) and then uninstall and install Erlang again?
Thank you so much for the tip, but it didn’t quite work for me. I followed you recipe but building Erlang from source didn’t “link” wxmac, resulting in errors. I tried looking up for a flag that I could update in the configure process, but I’m not really familiar with building Erlang from source.
It’s far from what I’m comfortable with as well, but that’s how we learn
Assuming you followed the brew build, you can try brew install --build-from-source --ignore-dependencies --HEAD erlang (to get homebrew to install erlang master), or to follow this and then rebuild erlang:
brew edit cdalvaro/tap/wxmac
Remove the bottle do block
Add “–enable-compat28”, to the args list in install
@michaelwm This solution worked for me. Thank you so much for sharing it.
@mattiaslundberg I think you solution would’ve worked too, but when I tried it, Erlang was recognizing the new wxmac as a dependency. That’s probably because of homebrew. Thanks anyway for your help.