Failed to build on Ubuntu 14.04: static_assert failed

Hi,

I tried to build the Unreal 4.8 from source on Ubuntu 14.04, but got tons of errors.

phoenix@tegra-ubuntu:~/unreal/UnrealEngine-4.8$ make 
bash "/home/phoenix/unreal/UnrealEngine-4.8"/Engine/Build/BatchFiles/Linux/Build.sh CrashReportClient Linux Development  
Building CrashReportClient...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Building UnrealHeaderTool...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Performing 21 actions (1 in parallel)
[1/21] Compile CorePrivatePCH.h
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/Core/CorePrivatePCH.h:4:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/Core/Private/CorePrivatePCH.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
[2/21] Compile Module.Json.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/Json/Module.Json.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/Json/Private/JsonModule.cpp:3:
In file included from Runtime/Json/Private/JsonPrivatePCH.h:5:
In file included from Runtime/Json/Public/Json.h:9:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
[3/21] Compile Module.Projects.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/Projects/Module.Projects.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/Projects/Private/ProjectsPrivatePCH.h:6:
In file included from Runtime/Projects/Public/Projects.h:9:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
[4/21] Compile Module.CoreUObject.1_of_4.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.1_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:10:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.1_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:18:
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:335:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:336:45: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Result |= UPTRINT(Tokens[CurrentIndex++]) << 32;
                                                          ^  ~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:411:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:413:28: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Stream[1] = UPTRINT(Ptr) >> 32;
                                         ^  ~~
7 errors generated.
[5/21] Compile Module.CoreUObject.3_of_4.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.3_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:10:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: erdjiror: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.3_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:18:
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:335:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:336:45: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Result |= UPTRINT(Tokens[CurrentIndex++]) << 32;
                                                          ^  ~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:411:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:413:28: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Stream[1] = UPTRINT(Ptr) >> 32;
                                         ^  ~~
7 errors generated.
[6/21] Compile Module.CoreUObject.2_of_4.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.2_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:10:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.2_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:18:
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:335:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:336:45: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Result |= UPTRINT(Tokens[CurrentIndex++]) << 32;
                                                          ^  ~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:411:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:413:28: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Stream[1] = UPTRINT(Ptr) >> 32;
                                         ^  ~~
7 errors generated.
[7/21] Compile Module.CoreUObject.4_of_4.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.4_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:10:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/CoreUObject/Module.CoreUObject.4_of_4.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Runtime/CoreUObject/Private/CoreUObjectPrivate.h:18:
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:335:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:336:45: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Result |= UPTRINT(Tokens[CurrentIndex++]) << 32;
                                                          ^  ~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:411:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:413:28: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Stream[1] = UPTRINT(Ptr) >> 32;
                                         ^  ~~
7 errors generated.
[8/21] Compile Module.UnrealHeaderTool.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/UnrealHeaderTool/Module.UnrealHeaderTool.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Programs/UnrealHeaderTool/Public/UnrealHeaderTool.h:7:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/UnrealHeaderTool/Module.UnrealHeaderTool.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Source/Programs/UnrealHeaderTool/Public/UnrealHeaderTool.h:8:
In file included from Runtime/CoreUObject/Public/CoreUObject.h:15:
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:335:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:336:45: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Result |= UPTRINT(Tokens[CurrentIndex++]) << 32;
                                                          ^  ~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:411:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:413:28: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Stream[1] = UPTRINT(Ptr) >> 32;
                                         ^  ~~
7 errors generated.
[9/21] Compile Module.ScriptGeneratorPlugin.cpp
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Plugins/ScriptGeneratorPlugin/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/ScriptGeneratorPlugin/Module.ScriptGeneratorPlugin.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Plugins/ScriptGeneratorPlugin/Source/ScriptGeneratorPlugin/Private/GenericScriptCodeGenerator.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Plugins/ScriptGeneratorPlugin/Source/ScriptGeneratorPlugin/Private/ScriptGeneratorPluginPrivatePCH.h:5:
In file included from ../Plugins/ScriptGeneratorPlugin/Source/ScriptGeneratorPlugin/Public/IScriptGeneratorPlugin.h:5:
In file included from Programs/UnrealHeaderTool/Public/IScriptGeneratorPluginInterface.h:4:
In file included from Runtime/Core/Public/Modules/ModuleManager.h:5:
In file included from Runtime/Core/Public/Modules/ModuleInterface.h:6:
In file included from Runtime/Core/Public/Core.h:9:
Runtime/Core/Public/HAL/Platform.h:641:2: error: static_assert failed "Pointer size is 64bit, but pointers are short."
        static_assert(!PLATFORM_64BITS || sizeof(void*) == 8, "Pointer size is 64bit, but pointers are short.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:644:2: error: static_assert failed "Unsigned char type test failed."
        static_assert(char(-1) < char(0), "Unsigned char type test failed.");
        ^             ~~~~~~~~~~~~~~~~~~
Runtime/Core/Public/HAL/Platform.h:677:2: error: static_assert failed "ANSICHAR type sign test failed."
        static_assert(int32(ANSICHAR(-1)) == -1, "ANSICHAR type sign test failed.");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Plugins/ScriptGeneratorPlugin/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/ScriptGeneratorPlugin/Module.ScriptGeneratorPlugin.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Plugins/ScriptGeneratorPlugin/Source/ScriptGeneratorPlugin/Private/GenericScriptCodeGenerator.cpp:2:
In file included from /home/phoenix/unreal/UnrealEngine-4.8/Engine/Plugins/ScriptGeneratorPlugin/Source/ScriptGeneratorPlugin/Private/ScriptGeneratorPluginPrivatePCH.h:6:
In file included from Runtime/CoreUObject/Public/CoreUObject.h:15:
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:335:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:336:45: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Result |= UPTRINT(Tokens[CurrentIndex++]) << 32;
                                                          ^  ~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:411:3: error: static_assert failed "Pointer size mismatch."
                static_assert(sizeof(void*) == 8, "Pointer size mismatch.");
                ^             ~~~~~~~~~~~~~~~~~~
Runtime/CoreUObject/Public/UObject/GarbageCollection.h:413:28: error: shift count >= width of type -Werror,-Wshift-count-overflow]
                Stream[1] = UPTRINT(Ptr) >> 32;
                                         ^  ~~
7 errors generated.
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: so
Total build time: 36.23 seconds
UnrealHeaderTool failed for target 'CrashReportClient' (platform: Linux, module info: /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/UnrealHeaderTool.manifest).
make: *** [CrashReportClient] Error 5

I have no idea how to modify what files to fix these issues.

Can anyone give me some advice?

Thanks!

It appears that you’re running a 32-bit version of Ubuntu. Although games can be made in Unreal for 32-bit operating systems, the editor only runs (and I guess compiles) under a 64-bit operating system.

Unfortunately, the easiest way to resolve this issue (to my knowledge) is to pick up and install a 64-bit version of Ubuntu.