How to use C++ Standard Library? (std)

Greetings,

I have a big C++ code base that I want to use in UE4. The code that I have written solely uses C++ Standard Library and nothing else. I simply want to use the C++ standard library but I get errors like the following:

Error : In XYZ: Unrecognized type 'std'

The solutions provided here and here did not help. I’ve also tried the following:

#include "AllowWindowsPlatformTypes.h"
#include <vector>
#include "HideWindowsPlatformTypes.h"

but it didn’t work either. How do I use stuff like the class?

Thanks in advance,

This sounds more like a syntax error than anything else. What code drops this error? Also I am able to compile against all the standard libraries

You should not use standard C++ library for other then communicating with external libraries and if you use them you should avoid using UFUNCTION and UPROPERTY on them. UE4 has it own standard library to ensure portability, because of that reflection system does not support std::vector or any other C++ standard type, thats why UHT (not compiler, it’s a tool that generates header files listing functions and properties for reflection system) throws you a error. If you want to use external library in game code you should first create wrapper classes in UObject environment that will convert standard types to UE4 types

1 Like