(resolution in thread) Struggling to get 3.1.5 working on macOS Big Sur

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
joubert
In need of some credit
In need of some credit
Posts: 2
Joined: Mon Jan 25, 2021 2:36 am

(resolution in thread) Struggling to get 3.1.5 working on macOS Big Sur

Post by joubert »

I am able to install 3.0.5 via

Code: Select all

brew install wxmac
just fine and it works nicely.
However, because 3.0.5 doesn't support Dark Mode, I'm interested to get 3.1.x working.

First, I tried

Code: Select all

brew install --HEAD wxmac
but that complains about "--enable-webkit" being an unrecognized option:
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at e094734 Fix numbered list in wxMenuEvent docs
Entering '3rdparty/catch'
Entering 'src/expat'
Entering 'src/jpeg'
Entering 'src/png'
Entering 'src/tiff'
Entering 'src/zlib'
/Users/joubert/Library/Caches/Homebrew/wxmac--git/3rdparty/catch
/Users/joubert/Library/Caches/Homebrew/wxmac--git/src/expat
/Users/joubert/Library/Caches/Homebrew/wxmac--git/src/jpeg
/Users/joubert/Library/Caches/Homebrew/wxmac--git/src/png
/Users/joubert/Library/Caches/Homebrew/wxmac--git/src/tiff
/Users/joubert/Library/Caches/Homebrew/wxmac--git/src/zlib
==> ./configure --prefix=/opt/homebrew/Cellar/wxmac/HEAD-e094734_1 --enable-clipboard --enable-controls --enable-dataviewctrl --enable-display --enable-dnd --enable-graphics
Last 15 lines from /Users/joubert/Library/Logs/Homebrew/wxmac/01.configure:
--enable-unicode
--enable-webkit
--enable-webview
--with-expat
--with-libjpeg
--with-libpng
--with-libtiff
--with-opengl
--with-osx_cocoa
--with-zlib
--disable-precomp-headers
--disable-monolithic
--with-macosx-version-min=11

configure: error: unrecognized options: --enable-webkit

Do not report this issue to Homebrew/brew or Homebrew/core!
So, now I'm trying to build wxWidgets myself with these steps:

Code: Select all

git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git 
cd wxWidgets
mkdir buildMacOS
cd buildMacOS
../configure
Everything good so far, with configure's output showing:

Code: Select all

Configured wxWidgets 3.1.5 for `arm-apple-darwin20.2.0'

  Which GUI toolkit should wxWidgets use?                 osx_cocoa
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.8      no
                                       wxWidgets 3.0      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               builtin
                                       png                builtin
                                       regex              builtin
                                       tiff               sys
                                       lzma               no
                                       zlib               sys
                                       expat              sys
                                       libmspack          no
                                       sdl                no
Now, I run

Code: Select all

make
but that gives this error:
/Users/joubert/temp/wxWidgets/buildMacOS/bk-deps g++ -std=gnu++11 -mmacosx-version-min=10.10 -c -o coredll_imagtiff.o -I../src/jpeg -I../src/png -I../src/regex -I/Users/joubert/temp/wxWidgets/buildMacOS/lib/wx/include/osx_cocoa-unicode-3.1 -I../include -D_FILE_OFFSET_BITS=64 -D__WXOSX_COCOA__ -DWXBUILDING -DWXUSINGDLL -DWXMAKINGDLL_CORE -DwxUSE_BASE=0 -dynamic -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -O2 -fno-common -fvisibility=hidden -fvisibility-inlines-hidden ../src/common/imagtiff.cpp
../src/common/imagtiff.cpp:37:14: fatal error: 'tiff.h' file not found
#include "tiff.h"
^~~~~~~~
1 error generated.
make: *** [coredll_imagtiff.o] Error 1
Suggestions?
Last edited by joubert on Tue Jan 26, 2021 4:07 pm, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Struggling to get 3.1.5 working on macOS Big Sur

Post by ONEEYEMAN »

Hi,
In the Terminal try

Code: Select all

git submodule update --init
Does it give any output?

Thank you.
joubert
In need of some credit
In need of some credit
Posts: 2
Joined: Mon Jan 25, 2021 2:36 am

Re: Struggling to get 3.1.5 working on macOS Big Sur

Post by joubert »

Thanks, even updating the submodules didn't help.

I did, however, figure out a solution.

Since I have libtiff installed via brew (with concomitant headers in "/opt/homebrew/include"), I was able to build wxWidgets by passing the include path to "configure" like so:

Code: Select all

../configure CXXFLAGS="-I/opt/homebrew/include"
I have also been able to use this manually-built wxWidgets in my (still toy) Nim project and it correctly renders in dark mode.
Post Reply