What am I doing wrong with Visual Studios?

I’ve been having this problem for awhile now and I can’t seem to find the solution to my problem.

Here is a screen capture picture of Visual Studios.

I did a fresh install of the source code for the UnrealEngine from github, and even followed the tutorial the second time. It compiles and everything, all is well and good. When I run the development editor and even install the UnrealEngine.exe for accessing the MarketPlace everything still works. But as soon as I add VS code to the project, I start getting errors in VS. I can edit other code just fine and the errors don’t show up, but as soon as I try to add my own code to the project, random things start to come up as errors. I think I have followed all the tutorials correctly. So, what am I doing wrong?

Here are the errors, in order as they appear in the screenshot:

Error: cannot open source file "DefaultHud.generated.h"

#define GENERATED_UCALSS-BODY() public: UchildConnection_RPC_WRAPPERS UChildConnection_CALLBACK_WRAPPERS UChildConnection_INCLASS public:
Error: expected an identifier

Thanks!

I was also wracking my brain trying to figure this out, but it turned out to be a non-issue. They shouldn’t prevent you from building. Once you build, they should go away.

What I believe is happening is that those includes are for auto-generated files that the engine uses to set up the class, but those don’t get built until you actually build the project. Someone else can feel free to correct me if I’m wrong.

This doesn’t seem to work, when I tried to compile it without touching anything else, I got these compile errors.

That error is probably caused by you having the editor open, close it and try building again

You can’t re-compile the code with UE open when you changed headers or added new classes/properties in your code.
Close Unreal Editor, build your code, open UE and re-compile any blueprint that were using changed classes.

I had the same problem twice.

First time was because i created my c++ classes inside of Visual Studio. You should create classes in the editor with the “Add code to project”.

Second time was because i tried networking stuff and forgot to write GetLifetimeReplicatedProps. You need this when you replicate variables for networking purposes.
This solved my issues. Good luck.