What I posted earlier does compile. I tested on my end.
error C2065: ‘Width’: undeclared identifier - Width not defined or included
error C2059: syntax error: ‘public’ - missing “:” after public?
‘UDisplay’: function should return a value; ‘void’ return type assumed - function not returning type it supposed to
‘StaticStruct’: is not a member of ‘FDisplayInfo’ - Using “StaticStruct” as a member of FDisplayInfo, which doesnt exist as a member
‘execGetDisplayResolutions’: undeclared identifier - Not defined or included
‘UDisplay’: undeclared identifier - Not defined or included in file
‘TClassCompiledInDefer’: ‘UDisplay’ is not a valid template type argument for parameter ‘TClass’ - invalid template
Now, with that said, because you are getting a “Exited with code 5. Please verify that you have sufficient rights to run this command” as a error, It is possible that the compiling errors are related to a macro trying to use something that doesn’t exist, causing a whole mess of issues with the generated.h compile.
Break down what you are trying to do into something smaller and go step-by-step, making sure the code compiles each time. If it doesn’t, try to figure out what the changes could of done. Make sure that if you use a UE4 class that the module that holds it is declared and that the header is included when being used.
Here is some documentation that might help:
https://docs.unrealengine.com/latest/INT/Programming/
https://docs.unrealengine.com/latest/INT/Programming/Tutorials/
https://docs.unrealengine.com/latest/INT/Programming/Introduction/