winnt.h(620): warning C4005: 'TEXT': macro redefinition and HAL/Platform.h(1085): note: see previous definition of 'TEXT'

If you are including Windows stuff you need a “header sandwich” to instruct Unreal to to prevent the macro/define collisions. Been using this over 5+ projects and works from Unreal 4.9 to 5.1:

// put this at the top of your .h file above #includes
// UE5: allow Windows platform types to avoid naming collisions
// must be undone at the bottom of this file!
#include "AllowWindowsPlatformTypes.h"
#include "prewindowsapi.h"

… your
… header
… file
… content

// put this at the bottom of the .h file
// UE5: disallow windows platform types
// this was enabled at the top of the file
#include "PostWindowsApi.h"
#include "HideWindowsPlatformTypes.h"

There’s a few old threads about this but added it here.