BackgroundMusic
BackgroundMusic copied to clipboard
background music doesn't build with Xcode 14.3
get errors about 'binary_function<AudioObjectPropertyAddress, AudioObjectPropertyAddress, bool>' is deprecated
From https://developer.apple.com/documentation/xcode-release-notes/xcode-14_3-release-notes
std::unary_function and std::binary_function are no longer available in C++17 and C++20. They can be re-enabled by defining _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION. They are also marked as [[deprecated]] in C++11 and later. To disable deprecation warnings you have to define _LIBCPP_DISABLE_DEPRECATION_WARNINGS. Note that this disables all deprecation warnings.
So one workaround would probably be to add -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION. I'm currently running Xcode 14.2 and haven't updated to 14.3 yet so I have not tested.
Turn off the "Treat Warnings as Errors" build setting and you should be good.