Compile Module.UnrealHeaderTool.cpp fails

Dear reader can you please look at Compile Module.UnrealHeaderTool.cpp fails - Pastebin.com this is pastebin of the error that I got while I was installing unreal ue4-4.13.1. I have mono4.6.0 and clang 3.8.1. and the Compile Module.UnrealHeaderTool.cpp failes to commpile with this ERROR: UBT ERROR: Failed to produce item: /tmp/nix-build-ue4-4.13.1.drv-0/UnrealEngine-4.13.1-release/Engine/Binaries/Linux/libUnrealHeaderTool-Core.so . I am using Nixos Linux, but this shouldnt be a problem. Any help appriciated. Kind regards.

I unpacked the source, edited this 3 files:

UnrealEngine-4.13.1-release/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformMisc.cpp:104:3:
UnrealEngine-4.13.1-release/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformProcess.cpp:1141:2: UnrealEngine-4.13.1-release/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformProcess.cpp:1395:2:

you put (void) infront of fscanf and getcwd. This way the script can continue running and the 3 warnings disappear.
This solves it.

I was talking with @amigo- irc channel #UE4linux and he suggested to remove -Werror from this file https://github.com/EpicGames/UnrealEngine/blob/4.13/Engine/Source/Programs/UnrealBuildTool/Linux/LinuxToolChain.cs#L303
This prints the warnings but you are still able to compile the program. I belive its a better solution because I have my warnings printed which is good for later when I read the log file. I am posting this even thou the program is still compiling, will edit later if it doesnt.

when the install finished and I try to run the UE4Editor this happens:

 [Me@nixos:~]$ UE4Editor
 ./UE4Editor: symbol lookup error: /home/Me/.config/unreal-engine-nix-workdir/Engine/Binaries/Linux/libUE4Editor-UnrealEd.so: undefined symbol: _ZN20UTrueTypeFontFactory12LoadFontFaceEPviP16FFeedbackContextPS0_
 
 [Me@nixos:~]$ echo _ZN20UTrueTypeFontFactory12LoadFontFaceEPviP16FFeedbackContextPS0_ | c++filt 
 UTrueTypeFontFactory::LoadFontFace(void*, int, FFeedbackContext*, void**)

Look at second asnwer.