Error when starting up a project

Assuming you are just starting with UE4 C++ and doing the Battery Collector tutorial, probably a missing pointer somewhere. Best thing you can do is checking your code and see what’s wrong. Since you are following the tutorial, just revert the changes you did in the latest tutorial and you should start again. Also feel free to post your code if you can’t find the culprit.

When I try to start up my project I get this error screen:

Not relaly sure what to to here, I already pressed send and restart and have tried to restart the project several times.

Please let me know if you need more information!

You are missing an include in your .cpp file.

#include "Classes/Components/StaticMeshComponent.h"

Since you are following an old tutorial with your 4.16 version, you can check out my post about the IWYU changes.

Also, would be great if you copy your code, remove the answer and put the code in the description instead, to clear things up <3.

So the staticmesh thing is indeed fixed now, with the include (I had an error on my RootComponent).

However, I got this new error now in my VS and I still cant start the project in UE4. http://imgur.com/a/YVwOC
The error says something about an older version of the SharedPCH.Engine.h.pch and that its trying to use a C++ version while I want to use a C version? This is very confusing and I don’t really know what to do with this.

I read your IWYU changes post and it helped me understand the includes a bit, which is great!

Looks like you upgraded your engine version, but I’m not 100% sure. Nonetheless, delete your Intermediate, Saved, Binaries, .vs folder and .sln file in your project folder. Then right-click your .uproject file and “Generate Visual Studio project files”. Open Visual Studio, let it finish parsing files, hit ctrl + f5 and report back.

Everything works fine again! :smiley: Thank you so much