Just upgraded my Xcode to 15.0, and suddenly it started giving me the following error in RCT_Folly
No template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
this is the line where it fails:
struct hash_base : std::unary_function<T, std::size_t> {};
I tried removing cached data and derived data & cleaning build. Tried removing pods and node_modules as well. But nothing has helped.
2
Answers
It's somehow silly but I resolved it by putting
__unary_function
as XCode is suggesting.So the actually line would be..
all library must update their code to use std::function & std::bind instead of unary_function
Workaround
Select Pods > Build Settings >
In section Apple Clang – Preprocessing > under Macro section
add in release & debug -> _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
ps : to add this just clic on the column then clic on "+" at the bottom -> then paste : _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION