Compile Unreal with gcc and system STL for linux

I am trying to compile Unreal with gcc and system STL(not the unreal provided STL i.e UNREAL STL).
I only have to support for Linux:

1. Can anyone suggest a version of gcc and c++ version to use.
2. Will unreal run smoothly if I use system STL instead of UNREAL STL.
3. Will this configuration also work on windows 10.

Could you tell a bit more what is the problem are you trying to solve?

BTW, there’s no “Unreal STL”, you are perhaps referring to libc++ bundled with the engine. You can switch to default libstdc++ by setting an environment variable UE4_LINUX_USE_LIBCXX to 0. However before doing that - what is the problem that is causing you to consider that?

Compiling with gcc is harder. UBT still contains remnants of gcc support, but we have not attempted it in quite a while. However, I have heard of licensees who were able to compile the engine with gcc, albeit with rather extensive changes to the code base.

I have a code base which I am trying to port to linux from windows and in the process I am finding it hard to compile it to linux.

We have few pre-compiled libs with no access to source code. These libs expose their public interface in terms of default libstdc++(i.e parameters are passed as std::string). When compiling unreal on linux with clang and unreal bundled stl, I get linking errors. So, this is the reason I want to compile unreal with gcc and default STL.

Try just switching from libc++ to libstdc++. clang and gcc are largely compatible so it is unlikely that you will run into further linking errors.

Keep in mind that bundling libstdc++ is risky and you need to consult a lawyer if you decide to bundle it. If you don’t bundle it with the resulting binary, you need to make sure that the users will not run it on a system where an incompatible version of libstdc++ is installed.