Mac and :observer.start - ERROR: Could not find 'wxe_driver.so'

I am new to Elixir, and am running on a Macbook Pro, Monterey 12.5. I am going through a course that uses :observer.start(). When I ran this in iex, I got this output:

iex(1)> :observer.start()

19:39:22.117 [error] ERROR: Could not find 'wxe_driver.so' in: /Users/matt.farabaugh/.asdf/installs/erlang/23.3.4.4/lib/wx-1.9.3.1/priv

{:error,
 {{:load_driver, 'No driver found'},
  [
    {:wxe_server, :start, 1, [file: 'wxe_server.erl', line: 65]},
    {:wx, :new, 1, [file: 'wx.erl', line: 115]},
    {:observer_wx, :init, 1, [file: 'observer_wx.erl', line: 107]},
    {:wx_object, :init_it, 6, [file: 'wx_object.erl', line: 404]},
    {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}
  ]}}

When I used asdf to reinstall erlang, I see a message related to wxwidgets:

 * wx             : wxWidgets was not compiled with --enable-compat28, wx will NOT be useable
 * Can not link the wx driver, wx will NOT be useable

However, when I look at the Homebrew formula for wxwidgets, which is installed, I see that compat28 has a line like this:

"--enable-compat28",

So I tried reinstalling wxwidgets with the --build-from-source option, and then tried to reinstall erlang. I got a new error, with partial log below from ~/.asdf/plugins/erlang/kerl-home/builds/asdf_23.3.4.4/otp_build_23.3.4.4.log
:

=== Entering application wx
make[3]: Nothing to be done for `opt'.
 CXX    x86_64-apple-darwin21.6.0/wxe_funcs.o
 CXX    x86_64-apple-darwin21.6.0/wxe_events.o
 CXX    x86_64-apple-darwin21.6.0/wxe_init.o
 CC     x86_64-apple-darwin21.6.0/wxe_driver.o
 CC     x86_64-apple-darwin21.6.0/wxe_ps_init.o
 CXX    x86_64-apple-darwin21.6.0/wxe_main.o
 CXX    x86_64-apple-darwin21.6.0/wxe_impl.o
 CXX    x86_64-apple-darwin21.6.0/wxe_helpers.o
 CXX    x86_64-apple-darwin21.6.0/wxe_callback_impl.o
 CXX    x86_64-apple-darwin21.6.0/wxe_return.o
 CXX    x86_64-apple-darwin21.6.0/wxe_gl.o
 CXX    x86_64-apple-darwin21.6.0/gl_funcs.o
 CXX    x86_64-apple-darwin21.6.0/egl_impl.o
In file included from gen/wxe_init.cpp:21:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_impl.cpp:25:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from gen/wxe_events.cpp:23:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_impl.cpp:25:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from gen/wxe_events.cpp:23:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_return.cpp:21:
In file included from ./wxe_return.h:31:
In file included from ./wxe_impl.h:29:
In file included from /usr/local/include/wx-3.2/wx/glcanvas.h:18:
In file included from /usr/local/include/wx-3.2/wx/app.h:19:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_helpers.cpp:21:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_gl.cpp:28:
In file included from ./wxe_impl.h:29:
In file included from /usr/local/include/wx-3.2/wx/glcanvas.h:18:
In file included from /usr/local/include/wx-3.2/wx/app.h:19:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_main.cpp:25:
In file included from ./wxe_impl.h:29:
In file included from /usr/local/include/wx-3.2/wx/glcanvas.h:18:
In file included from /usr/local/include/wx-3.2/wx/app.h:19:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from gen/wxe_funcs.cpp:23:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
In file included from wxe_callback_impl.cpp:21:
In file included from /usr/local/include/wx-3.2/wx/wx.h:24:
In file included from /usr/local/include/wx-3.2/wx/event.h:22:
In file included from /usr/local/include/wx-3.2/wx/cursor.h:75:
/usr/local/include/wx-3.2/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extens
ion [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
 CC     ../priv/x86_64-apple-darwin21.6.0/erl_gl.so
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
gen/wxe_funcs.cpp:8289:28: error: taking the address of a temporary object of type 'wxBitmap' [-Waddress-of-temporary]
 const wxBitmap * Result = &This->GetBitmap();
                           ^~~~~~~~~~~~~~~~~~
gen/wxe_funcs.cpp:8495:57: error: call to member function 'AddTool' is ambiguous
 wxToolBarToolBase * Result = (wxToolBarToolBase*)This->AddTool(*toolid,label,*bitmap,shortHelp,kind);
                                                  ~~~~~~^~~~~~~
/usr/local/include/wx-3.2/wx/tbarbase.h:311:24: note: candidate function
    wxToolBarToolBase *AddTool(int toolid,
                       ^
/usr/local/include/wx-3.2/wx/tbarbase.h:527:24: note: candidate function
    wxToolBarToolBase *AddTool(int toolid,
                       ^
1 warning generated.
1 warning generated.
1 warning and 2 errors generated.
make[3]: *** [x86_64-apple-darwin21.6.0/wxe_funcs.o] Error 1
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

Please keep it simple. I’m new to Macs generally.

Thanks

4 Likes

I just had this error with Erlang 25.1.1 and Elixir 1.14.0-rc.1-otp-25 on MacOS Monterey 12.3. For me, the fix was:

asdf uninstall erlang 25.1.1
brew install wxwidgets
asdf install erlang 25.1.1

I found this from this post about Ubuntu, leading to this issue comment, leading to these instructions for setting up asdf-erlang.

3 Likes