I pulled the latest Unreal Engine a few days ago and I was able to build and run it just fine by following the quickstart guide. I have some external libraries compiled with my system’s GCC and linked to my system’s libstdc++ that I would like to use as external modules. I immediately ran into C++ ABI problems of course because I linked with libstdc++ while Unreal is using it’s own toolchain’s libc++. I would like to recompile Unreal Engine to link against my system’s libstdc++. I understand the ramifications of this and I know whatever I build will only work with my system and that’s expected and fine.
My system is Ubuntu 18 with gcc 7.5.0:
gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Output of uname -a
uname -a
Linux <...> 5.4.0-65-generic #73~18.04.1-Ubuntu SMP Tue Jan 19 09:02:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
The build errors imply the wrong stdlib headers are being found, or the stdlib headers aren’t even being found, or somehow they are found but -std=c++14 isn’t being passed. I’ve at least confirmed -std=c++14 is being passed.
Build errors:
------- Build details --------
Using toolchain located at '.../workspace/unreal/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu'.
Using clang (.../workspace/unreal/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++) version '10.0.1' (string), 10 (major), 0 (minor), 1 (patch)
Using compiler default (most likely libstdc++) standard C++ library.
Using lld linker
Using llvm-ar : .../workspace/unreal/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v17_clang-10.0.1-centos7/x86_64-unknown-linux-gnu/bin/llvm-ar
Using fast way to relink circularly dependent libraries (no FixDeps).
------------------------------
Performing 38 actions (12 in parallel)
[5/38] Compile SharedPCH.Core.ShadowErrors.h
[2/38] Compile PCH.CoreUObject.h
[3/38] Compile Module.TraceLog.cpp
[4/38] Compile BuildSettings.cpp
[6/38] Compile Module.UnrealHeaderTool.cpp
[1/38] Compile PCH.Core.h
[7/38] Link (lld) libUnrealHeaderTool-BuildSettings.so
In file included from .../workspace/unreal/Engine/Intermediate/Build/Linux/B4D820EA/UnrealHeaderTool/Development/Core/SharedPCH.Core.ShadowErrors.h:59:
In file included from .../workspace/unreal/Engine/Source/Runtime/Core/Public/CoreSharedPCH.h:65:
In file included from Runtime/Core/Public/Containers/Map.h:14:
.../workspace/unreal/Engine/Source/Runtime/Core/Public/Templates/Tuple.h:66:89: error: no member named 'is_same' in namespace 'std'
constexpr static uint32 Value = TTypeCountInParameterPack<T, Types...>::Value + (std::is_same<T, U>::value ? 1 : 0);
~~~~~^
.../workspace/unreal/Engine/Source/Runtime/Core/Public/Templates/Tuple.h:66:97: error: 'T' does not refer to a value
constexpr static uint32 Value = TTypeCountInParameterPack<T, Types...>::Value + (std::is_same<T, U>::value ? 1 : 0);