UE 5.8 fails to compile with Visual Studio 2026 (hash_map missing) — Source fix

There’s nothing like editing the engine, right guys?

Imagine having to come and see what you’re doing…

Summary
#if USE_HASHMAP
#if PLATFORM_MAC || PLATFORM_LINUX
#include <unordered_map>
#include <vector>
#else
#include <hash_map>
#endif
#else
#include <map>
#endif

image

Summary
#elif USE_HASHMAP
		typedef stdext::hash_map<Edge, Edge> EdgeDict;
		typedef stdext::hash_map<nv::Vector3, Corner> PositionDict;

With MSVC 14.51, it seems that <hash_map> is no longer available (or at least not where that code expects to find it). It seems that this code hasn’t been updated when the compiler changed.

I’m getting rid of the platform-specific code like #if PLATFORM_MAC || PLATFORM_LINUX, which I understand was for legacy systems, and if not, then to keep it.

Changed:

Summary
#if USE_HASHMAP
#include <unordered_map>
#include <vector>
#else
#include <map>
#endif

image

Summary
#elif USE_HASHMAP
		typedef std::unordered_map<Edge, Edge> EdgeDict;
		typedef std::unordered_map<nv::Vector3, Corner> PositionDict;

I’m getting a bit tired of having to look up every little thing for the new version. If you’re going to set a version that’s compatible with “VS 2026,” one bad synchronization with Microsoft and you’ll leave us developers out of the game. Please, a little more professionalism.

I can’t be keeping track of every existing library you remove or don’t remove. It really annoys me.

What are we waiting for?

Unreal Engine should keep a closer eye on the MSVC versions used by Visual Studio. Unreal Engine is built in close conjunction with Visual Studio and Microsoft libraries. It is advisable to check for the latest versions available in Visual Studio whenever a new release is made, in order to avoid compatibility issues.

You’re welcome, regards.