I tried compiling wxWidgets from source per Erlang 24.0 installation error message: wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed · Issue #203 · asdf-vm/asdf-erlang · GitHub 2 but that caused a different error:
error: call to member function ‘AddTool’ is ambiguous
Same problem for me. I’m using OSX 12.2.1 (Apple M1 Pro). I can’t install Erlang 24, 23, or 22. Same error. I have the latest version of Xcode installed, and I installed the command line tools via:
$ xcode-select —install
I opened an issue here:
opened 04:02AM - 11 May 22 UTC
closed 05:35PM - 11 May 22 UTC
I used MacPorts to install the prerequisites listed for OSX here:
https://git… hub.com/asdf-vm/asdf-erlang#osx
including wxWidgets. But, when I tried to install the latest Erlang, the output said something about wxWidgets:
```
wx : wxWidgets was not compiled with --enable-webview or wxWebView developer
package is not installed, wxWebView will NOT be available
```
Here's the output:
```
~% asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
~% asdf latest erlang
24.3.4
~% asdf install erlang 24.3.4
asdf_24.3.4 is not a kerl-managed Erlang/OTP installation
No build named asdf_24.3.4
Downloading 24.3.4 to /Users/7stud/.asdf/downloads/erlang/24.3.4...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 102M 100 102M 0 0 12.9M 0 0:00:07 0:00:07 --:--:-- 14.1M
Extracting source code
Building Erlang/OTP 24.3.4 (asdf_24.3.4), please wait...
APPLICATIONS DISABLED (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
* jinterface : No Java compiler found
* odbc : ODBC library - link check failed
APPLICATIONS INFORMATION (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
* crypto : Using OpenSSL 3.0 is not yet recommended for production code.
* wx : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
* wxWidgets must be installed on your system.
* Please check that wx-config is in path, the directory
* where wxWidgets libraries are installed (returned by
* 'wx-config --libs' or 'wx-config --static --libs' command)
* is in LD_LIBRARY_PATH or equivalent variable and
* wxWidgets version is 3.0.2 or above.
Erlang/OTP 24.3.4 (asdf_24.3.4) has been successfully built
Cleaning up compilation products for
Cleaned up compilation products for under /Users/7stud/.asdf/plugins/erlang/kerl-home/builds
```
Luckily, issue [#203 ](https://github.com/asdf-vm/asdf-erlang/issues/203) provided some guidance. I used MacPorts to uninstall wxWidgets, then I followed the instructions posted by `conradwt` to manually install wxWidgets. After some trials, I got `./configure`, `make`, and `sudo make install` to run error free, but now I can't install Erlang:
```
~% asdf install erlang 24.3.4
asdf_24.3.4 is not a kerl-managed Erlang/OTP installation
The asdf_24.3.4 build has been deleted
Extracting source code
Building Erlang/OTP 24.3.4 (asdf_24.3.4), please wait...
APPLICATIONS DISABLED (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
* jinterface : No Java compiler found
* odbc : ODBC library - link check failed
APPLICATIONS INFORMATION (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
* crypto : Using OpenSSL 3.0 is not yet recommended for production code.
Build failed.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2
Please see /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log for full details.
```
Here is the error listed in `otp_build_24.3.4.log`:
```
In file included from gen/wxe_wrapper_6.cpp:23:
In file included from /usr/local/include/wx-3.1/wx/wx.h:24:
In file included from /usr/local/include/wx-3.1/wx/event.h:22:
In file included from /usr/local/include/wx-3.1/wx/cursor.h:75:
/usr/local/include/wx-3.1/wx/utils.h:749:35: warning: default member initializer for non-static d$
wxEventLoop* m_modalEventLoop = NULL;
^
gen/wxe_wrapper_7.cpp:2342:58: error: call to member function 'AddTool' is ambiguous
wxToolBarToolBase * Result = (wxToolBarToolBase*)This->AddTool(toolId,label,*bitmap,shortHelp,k$
~~~~~~^~~~~~~
/usr/local/include/wx-3.1/wx/tbarbase.h:311:24: note: candidate function
wxToolBarToolBase *AddTool(int toolid,
^
/usr/local/include/wx-3.1/wx/tbarbase.h:527:24: note: candidate function
wxToolBarToolBase *AddTool(int toolid,
^
1 warning and 1 error generated.
```
I also can't install Erlang 23.3.4.14:
```
~% asdf install erlang 23.3.4.14
asdf_23.3.4.14 is not a kerl-managed Erlang/OTP installation
No build named asdf_23.3.4.14
Downloading 23.3.4.14 to /Users/7stud/.asdf/downloads/erlang/23.3.4.14...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 94.7M 100 94.7M 0 0 12.4M 0 0:00:07 0:00:07 --:--:-- 14.3M
Extracting source code
Building Erlang/OTP 23.3.4.14 (asdf_23.3.4.14), please wait...
APPLICATIONS DISABLED (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_23.3.4.14/otp_build_23.3.4.14.log)
* jinterface : No Java compiler found
* odbc : ODBC library - link check failed
Build failed.
In file included from /usr/local/include/wx-3.1/wx/event.h:22:
In file included from /usr/local/include/wx-3.1/wx/cursor.h:75:
/usr/local/include/wx-3.1/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
wxEventLoop* m_modalEventLoop = NULL;
^
1 warning generated.
1 warning generated.
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2
Please see /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_23.3.4.14/otp_build_23.3.4.14.log for full details.
```
From otp_build_23.3.4.14.log:
```
In file included from wxe_callback_impl.cpp:21:
In file included from /usr/local/include/wx-3.1/wx/wx.h:24:
In file included from /usr/local/include/wx-3.1/wx/event.h:22:
In file included from /usr/local/include/wx-3.1/wx/cursor.h:75:
/usr/local/include/wx-3.1/wx/utils.h:749:35: warning: default member initializer for non-static d$
wxEventLoop* m_modalEventLoop = NULL;
^
1 warning generated.
CXX arm-apple-darwin21.4.0/wxe_gl.o
1 warning generated.
CXX arm-apple-darwin21.4.0/gl_funcs.o
gen/wxe_funcs.cpp:8289:28: error: taking the address of a temporary object of type 'wxBitmap' [-W$
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,k$
~~~~~~^~~~~~~
/usr/local/include/wx-3.1/wx/tbarbase.h:311:24: note: candidate function
wxToolBarToolBase *AddTool(int toolid,
^
/usr/local/include/wx-3.1/wx/tbarbase.h:527:24: note: candidate function
wxToolBarToolBase *AddTool(int toolid,
^
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.1/wx/glcanvas.h:18:
```
Okay...somehow I got erlang 24.3.4 installed. The last thing I tried was deleting my manual installation of wxWidgets and manually reinstalling wxWidgets (manual installation instructions are listed in issue #203 by conradwt):
```
~% ls
Computing Downloads Music erlang_programs
Desktop Library Pictures wxWidgets
Documents Movies Public
~% rm -rf ./wxWidgets
```
I did add one flag to `~/.zshrc`:
`--with-ssl-incl=/opt/local`:
So, this is what I have for asdf in my `~/.zshrc` file:
```
#For asdf:
. $HOME/.asdf/asdf.sh
#For asdf erlang installs with wxWidgets:
export KERL_BUILD_DOCS=yes
export KERL_INSTALL_MANPAGES=yes
export wxUSE_MACOSX_VERSION_MIN=11.3
export EGREP=egrep
export CC=clang
export CPP="clang -E"
export KERL_USE_AUTOCONF=0
export KERL_CONFIGURE_OPTIONS="--disable-debug \
--disable-hipe \
--disable-sctp \
--disable-silent-rules \
--enable-darwin-64bit \
--enable-dynamic-ssl-lib \
--enable-kernel-poll \
--enable-shared-zlib \
--enable-smp-support \
--enable-threads \
--enable-wx \
--with-ssl=/opt/local \
--with-ssl-incl=/opt/local \
--with-wx-config=/usr/local/bin/wx-config \
--without-javac \
--without-jinterface \
--without-odbc"
```
Maybe those flags need to be setup up in `~/.zshrc` BEFORE installing wxWidgets? Of course, make sure you start a new shell whenever you make any changes to `~/.zshrc`! My macbook asked to update my system last night, and I stupidly said yes, and now I see that I have macOS 12.3.1, so I think that update is the most likely reason I was suddenly able to install erlang without error.
Here's the terminal output produced by the successful installation:
```
~% asdf latest erlang
24.3.4
~% asdf install erlang 24.3.4
asdf_24.3.4 is not a kerl-managed Erlang/OTP installation
The asdf_24.3.4 build has been deleted
Extracting source code
Building Erlang/OTP 24.3.4 (asdf_24.3.4), please wait...
APPLICATIONS DISABLED (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
* jinterface : Java compiler disabled by user
* jinterface : User gave --without-jinterface option
* odbc : User gave --without-odbc option
APPLICATIONS INFORMATION (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
* crypto : Using OpenSSL 3.0 is not yet recommended for production code.
Building docs...
Erlang/OTP 24.3.4 (asdf_24.3.4) has been successfully built
Cleaning up compilation products for
Cleaned up compilation products for under /Users/7stud/.asdf/plugins/erlang/kerl-home/builds
~%
```
Then I did:
```
~% erl
No version is set for command erl
Consider adding one of the following versions in your config file at
erlang 24.3.4
~% asdf list erlang
24.3.4
~% asdf global erlang 24.3.4
~% erl
Erlang/OTP 24 [erts-12.3.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Eshell V12.3.2 (abort with ^G)
1>
```
I tested wxWidgets by launching `observer` in the shell:
```
1> observer:start().
ok
```
and the observer window popped up, so wxWidgets seems to be working.
Good luck!
Hmm…I got erlang 24.3.4 installed, but I’m not sure why it worked on this attempt. The last thing I tried was deleting my manually installed wxWidgets:
~% ls
Computing Downloads Music erlang_programs
Desktop Library Pictures wxWidgets
Documents Movies Public
~% rm -rf ./wxWidgets
Then I manually reinstalled wxWidgets per conradwt’s instructions in issue #203 . I did add one flag to ~/.zshrc
:
--with-ssl-incl=/opt/local
based on josevalim’s post here . I highly doubt that was necessary. So, this is what I have for asdf in my ~/.zshrc
file:
#For asdf:
. $HOME/.asdf/asdf.sh
#For asdf erlang installs with wxWidgets:
export KERL_BUILD_DOCS=yes
export KERL_INSTALL_MANPAGES=yes
export wxUSE_MACOSX_VERSION_MIN=11.3
export EGREP=egrep
export CC=clang
export CPP="clang -E"
export KERL_USE_AUTOCONF=0
export KERL_CONFIGURE_OPTIONS="--disable-debug \
--disable-hipe \
--disable-sctp \
--disable-silent-rules \
--enable-darwin-64bit \
--enable-dynamic-ssl-lib \
--enable-kernel-poll \
--enable-shared-zlib \
--enable-smp-support \
--enable-threads \
--enable-wx \
--with-ssl=/opt/local \
--with-ssl-incl=/opt/local \
--with-wx-config=/usr/local/bin/wx-config \
--without-javac \
--without-jinterface \
--without-odbc"
Maybe those .zshrc
flags need to be setup up BEFORE installing wxWidgets? Don’t forget to start a new shell when you make any changes to ~/.zshrc
!
I just realized that last night I was prompted to update macOS 12.2.1, and I stupidly said yes. So, now I have macOS 12.3.1. I think that is the most likely reason I was suddenly able to install erlang 24.3.4
I tested wxWidgets by launching observer
in the shell:
~/erlang_programs% erl
Erlang/OTP 24 [erts-12.3.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Eshell V12.3.2 (abort with ^G)
1> observer:start().
ok
And, the observer window opened, and everything seems to be working fine.