Hope this little information helps you to understand my problem as I have no clue of the issue (I tried: checking UE files, deleting binaries and generating vs files)
What is the error message you get when you compile your project? Often those errors with the red-squiggly lines aren’t actually errors - just MSVC not parsing that bit of code in its realtime parsing…
unless you are compiling from Source "don’t worry about Errors in the engines files, they should be marked Read Only anyways.
if this was your own code file built on top of the engine then you “Should” only be dealing with .h files and not directly including a .cpp much less a .gen.cpp
the only things that should be dealing with including the .cpp much less .gen.cpp is the batch file(s) which for Unreal should be left to the Unreal Build Tool.
for the most part unless the user is compiling from source, they shouldn’t be worrying about “errors” in the engine files (though those would still only target .h files for inlcudes)
my statement would be more targeted towards someone writing their own cpp files