Xlocale.h not found on Linux

The xlocale header isn’t being found.

[1/3] Compile PCH.ImageWrapper.h In
file included from
/tmp/makepkg/unreal-engine/src/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Shipping/ImageWrapper/PCH.ImageWrapper.h:44:
In file included from
/tmp/makepkg/unreal-engine/src/UnrealEngine/Engine/Source/Runtime/ImageWrapper/Private/ImageWrapperPrivatePCH.h:16:
In file included from
/tmp/makepkg/unreal-engine/src/UnrealEngine/Engine/Source/Runtime/ImageWrapper/Private/ExrImageWrapper.h:12:
In file included from
/tmp/makepkg/unreal-engine/src/UnrealEngine/Engine/Source/ThirdParty/openexr/Deploy/include/ImathBox.h:65:
In file included from
ThirdParty/openexr/Deploy/include/ImathVec.h:46:
In file included from
ThirdParty/openexr/Deploy/include/ImathExc.h:47:
In file included from
ThirdParty/openexr/Deploy/include/IexBaseExc.h:50:
In file included from
ThirdParty/Linux/LibCxx/include/c++/v1/sstream:174:
In file included from
ThirdParty/Linux/LibCxx/include/c++/v1/ostream:138:
In file included from
ThirdParty/Linux/LibCxx/include/c++/v1/ios:216:
ThirdParty/Linux/LibCxx/include/c++/v1/__locale:39:11:
fatal error: ‘xlocale.h’ file not
found

include

      ^~~~~~~~~~~ 1 error generated. ERROR: UBT ERROR: Failed to

produce item:
/tmp/makepkg/unreal-engine/src/UnrealEngine/Engine/Binaries/Linux/CrashReportClient
Total build time: 3.26 seconds (Local
executor: 0.00 seconds) make: ***
[Makefile:252:
CrashReportClient-Linux-Shipping]
Error 5

hello,

i have the same issue. this helped me to move further:

ln -s /usr/include/locale.h /usr/include/xlocale.h

they say xlocale.h is threadsafe version of locale.h; hope locale.h is fine too.

1 Like

Yeah, that would work. My understanding is Unreal bundles all versions of third party libraries needed with it. Going to have to figure out which package for Arch has xlocale in the meantime.

Quick Answer:

Recompile the editor. Everything should work as intended.

The long answer:

The issue is with the glibc update

tar -tf /var/cache/pacman/pkg/glibc-2.25-7-x86_64.pkg.tar.xz  2>/dev/null| grep xlocal 
usr/include/xlocale.h

vs

tar -tf /var/cache/pacman/pkg/glibc-2.26-4-x86_64.pkg.tar.xz  2>/dev/null| grep xlocal

Not sure how why and when they decided to start dropping header files from glibc but hey, warning would be nice.

Not an UE4 Issue per se, but more of an bleeding edge issue.

By the way, there are several bugs created for this 1464244 – XS modules fail to build because <xlocale.h> does not exist

Maybe a PR for the engine is in order as this seems to be a trend to remove the xlocale.h and would affect other distributions soon enough

Here is the glibc commit:
https://sourceware.org/git/?p=glibc.git;a=commit;h=f0be25b6336db7492e47d2e8e72eb8af53b5506d

I think that is is best if the symbol link was place here

UnrealEngine/Engine/Source/ThirdParty/Linux/LibCxx/include/c++/v1> ln -s /usr/include/locale.h xlocale.h

This way you are not corrupting your host system. You never know how it will affect your system sometime in the future

I’ll have to look around once 4.18 comes out. I think the cache should be free I build in ram, and the ccache patch for Unreal was never finished.

Under OpenSuSE Tumbleweed recompiling did not work for me…

Actually I see what you mean… I will wait for an official update to Tumbleweed before I remove my symbol link

As mentioned above, recompiling the engine fixes everything, no need to link anything.

I do recompile the engine. I’m one of the maintainers of the aur release version of Unreal. Which patch do I need to pull in to get the engine to compile correctly?

To be honest I compile it with your patches with no issue. Also compiles without patches provided you use the older clang.

Probably clean the build cache? I always do fresh checkout from git before build.

Actually it’s in the release notes of glibc:

4.1. Removal of ‘xlocale.h’

The nonstandard header xlocale.h has
been removed in this release. It was
never intended to be included directly
by programs other than glibc itself,
and it was a strict subset of the
standard header locale.h. We know that
a number of programs do include it,
but because it has never been part of
any other C library, programs that use
it are probably testing for its
existence with autoconf or a similar
tool, and should not fail to compile.

Release/2.26 - glibc wiki

As an addition to previous answers I can tell there is a UE4_LINUX_USE_LIBCXX environment variable. Just

export UE4_LINUX_USE_LIBCXX=0

before build and UBT will use system glibc++ instead of shipped one.

BTW. there is a commit in 4.18 branch which fixes the problem.

Surprisingly commenting out the include statement in:

./Engine/Source/ThirdParty/Linux/LibCxx/include/c++/v1/__locale

worked for me… Looks like other headers that are included already provide what is needed.

It’s totally bad idea to mess up with third party source code (it seems like you didn’t even understand what you were doing). Builds is not equal to works.

OK, you are somewhat right, that I should have done some more investigation about this. So I found, that this is actually the solution to the problem.
According to glibc Release Notes 2.26 :

  • The nonstandard header xlocale.h has been removed. Most programs should
    use locale.h instead. If you have a specific need for the definition of
    locale_t with no other declarations, please contact
    libc-alpha@sourceware.org and explain.

So obviously the glibc developers have included all standard content of xlocale.h into locale.h, which is also included in the file, that I modified.

After my investigation I’m no more that surprised. If you agree, I would edit my comment above accordingly.

And here is the official Patch from libcxx:

--- libcxx/trunk/include/__locale	2017/05/31 22:14:05	304360
+++ libcxx/trunk/include/__locale	2017/08/03 04:28:10	309920
@@ -34,7 +34,7 @@
 # include <support/solaris/xlocale.h>
 #elif defined(_NEWLIB_VERSION)
 # include <support/newlib/xlocale.h>
-#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
+#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
 # include <xlocale.h>
 #elif defined(__Fuchsia__)

Refer to: Patch Source

I’m using Tumbleweed, too. See my answer below.

Surely well done!

Can you say how to clean build cache?

Looks like xlocale.h has been removed in glibc 2.26.

See:

https:/ . /www . .linuxquestions.org/questions . /slackware-14/ no-luck-with-libc-on-current-xlocale-h-missing-4175612648/
https:/ /sourceware.or . g/glibc/wiki/Release/2.26# . Removal_of_.27xlocale.h.27
Looks like MeTA is using a custom FindICU that hasn’t been updated for ~2 years. However, it seems that cmake 3.7 has it’s own FindICU. Maybe switching to that will pull in a more up-to-date ICU that has been patched for glibc 2.26?
TUTUApp Vip 9Apps Fast Download Aptoide APK