skip to Main Content

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


  1. Chosen as BEST ANSWER

    It's somehow silly but I resolved it by putting __unary_function as XCode is suggesting.

    So the actually line would be..

    struct hash_base : std::__unary_function<T, std::size_t> {};


  2. 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

     preview add line

    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
     preview add line

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search