build failure on Sonoma Arm Mac in KDDockWidgets because of old g++ version
I'm getting errors like this:
Documents/GitHub/MuseScore/thirdparty/KDDockWidgets/src/LayoutSaver.cpp:37:
In file included from /opt/homebrew/lib/QtCore.framework/Headers/QFile:1:
/opt/homebrew/lib/QtCore.framework/Headers/qfile.h:195:29: error: 'path' is unavailable: introduced in macOS 10.15
I tried adding an extra set(CMAKE_CXX_STANDARD 17) in thirdparty/KDDockWidgets/CMakeLists.txt
and also tried export CXXFLAGS=-std=c++17 in the shell.
I know the latter did something because I originally had a typo and it complained when I deleted the builds directory and started afresh, but then I still ended up with the same errors once I fixed that. Not sure what to try next. I guess I can reinstall Qt the approved way if nothing else comes to mind.
Comments
This means most likely that you are using a too-new version of Qt. MuseScore currently needs 6.2.x. Using a newer version of Qt would require raising the deployment target version from 10.14 to 10.15 (see
buildscripts/cmake/SetupBuildEnvironment.cmake
, near the bottom. But using a newer version of Qt also introduces a lot of weird mysterious problems (like crashes, or toolbars not being rendered), so unless you're interested in trying to solve those problems (which would be very welcome of course) I would advise against that, and instead recommend just using Qt 6.2.x.