Can't compile Project with Unreal Engine 5.1

I had a successfully compiling project in 5.0 and I thought of trying out 5.1, but I get this error message in visual studio:

D:\Engines\UE_5.1\Engine\Intermediate\Build\Win64\UnrealEditor\Inc\Engine\UHT\KismetSystemLibrary.generated.h(40): fatal error C1189: #error: "KismetSystemLibrary.generated.h already included, missing '#pragma once' in KismetSystemLibrary.h"

I cannot find anything on google, UDN or here. I know the kind of error isn’t unknown, but it’s obviously in the engine code, so I can’t change anything without customizing the whole thing. I installed vs2022 for this, after 2019 didn’t work either. The error stayed, though. I removed the usual subjects as well, like /.vs, /Intermediate, /Binaries and /DerivedDataCache.

I would be really grateful for help or I would have to downgrade the engine version again.

Update: In case anyone else has a similiar issue and needs a solution. I had an absolute path in my includes to the 5.0 version. I got no error message to this problem, as the 5.0 version was still installed, so the path was valid.

2 Likes

Thanks for the update. The error’s cause is indeed an include file which is from another engine version.