In 4.8.2 anytime I modify the generated GameMode.h header for a C++ project (I tried both 3rd and 1st Person Templates) the project stops compiling

in 4.8.2 anytime I modify the generated GameMode.h header for a C++ project (I tried both the 3rd and 1st Person Templates) the project stops working. All I have to do for it to break is add another #include and it stops compiling

50749-unreal+error.png

Doing the same thing in 4.7.6 works perfectly.

I was following the C++ 3rd person tutorial and when I got to the game mode and tried to add an enum class to the header, the project just stopped building properly.

Could you provide the output from when you compile it? The error in the screenshot occurs because the code generation needs to be rerun.

Thanks! That was very helpful!
Somehow being new to UCLASS was throwing me, I was trying to fix the problems in the Error List. By looking at the output I found the real reson the project was not compiling.
Still, in 4.7.6 intelliSense was not complaining about the UCLASS as it does here, that also sent me looking in ther wrong place.

It’s fine now Thanks!

Modifying the header file seems to invalidate the MyClass.generated.h. If errors are related to the generated code (e.g. the UCLASS macro, binding to delegates, etc.) it is worth at least doing a compile so at least you get real errors (or, as in this case, eliminating them!).

I just ran into the same problem.

Solution was to close Visual Studio and Unreal Editor, then go to your project folder like …

C:\Users\…\Documents\Unreal Projects\MyProject1

… and delete the Intermediate folder, then right click your MyProject1.uproject file and select …

Generate Visual Studio project files

When he is done, open your project again in Unreal Editor / Visual Studio and you should be fine. :slight_smile:

Edit

I also found out that those errors mostly have their origin in a problem in your code. So instead listening to what the Error List output says, switch to the Output tab, scroll up a bit and you should see the cause.