UE 5.1 Source game project build fails on MacOSX

I am trying to build my client configuration of my project on MacOSX, also through Jenkins, but I am getting this error:

02:16:29 [11/60] Compile Module.UnrealHeaderTool.2_of_2.cpp
02:16:29 In file included from ../Intermediate/Build/Mac/x86_64/UnrealHeaderTool/Development/UnrealHeaderTool/Module.UnrealHeaderTool.2_of_2.cpp:6:
02:16:29 /Users/Shared/EpicGames/UE_5.1.1_Source/Engine/Source/Programs/UnrealHeaderTool/Private/PropertyTypes.cpp:432:109: error: no member named 'ref' in namespace 'std'
02:16:29                 return PropertyTypeDispatch<CreateEngineTypeDispatch, bHandleContainers, FProperty*>(PropDef, Scope, std::ref(Name), ObjectFlags);
02:16:29                                                                                                                      ~~~~~^
02:16:29 /Users/Shared/EpicGames/UE_5.1.1_Source/Engine/Source/Programs/UnrealHeaderTool/Private/PropertyTypes.cpp:2939:107: error: no member named 'ref' in namespace 'std'
02:16:29         return PropertyTypeDispatch<DefaultValueStringCppFormatToInnerFormatDispatch, false, bool>(PropDef, std::ref(CppForm), std::ref(OutForm));
02:16:29                                                                                                             ~~~~~^
02:16:29 /Users/Shared/EpicGames/UE_5.1.1_Source/Engine/Source/Programs/UnrealHeaderTool/Private/PropertyTypes.cpp:2939:126: error: no member named 'ref' in namespace 'std'
02:16:29         return PropertyTypeDispatch<DefaultValueStringCppFormatToInnerFormatDispatch, false, bool>(PropDef, std::ref(CppForm), std::ref(OutForm));
02:16:29                                                                                                                                ~~~~~^
02:16:29 3 errors generated.

What am I doing wrong? The error doesn’t make much sense.

I’m running this command:

/Users/Shared/EpicGames/UE_5.1.1_Source/Engine/Build/BatchFiles/Mac/Build.sh MyProjectClient Mac Development -Project=/path/to/project/MyProject.uproject -WaitMutex -FromMsBuild
1 Like

Do you solve the problem? what is your Xcode version? I have met the same problem with Xcode 14.3.1 and UE 5.1.0.

Hi had this problem updating xcode, I’ve fixed simply adding #include <functional>

Hey!
I stumbled across this post…
Is there any chance you could guide us where did you add that include line?