Compile error UE4.27

Repro steps:

  1. Create New 3rd person (C++) game project.
  2. Open C++ class in visual studio 2022

Compiler complains about CoreNet.h, lines 351-353, 373-375.

E1455: member function declared with ‘override’ does not override a base class member.

These are the lines it is complaining about. This is readonly code in the Unreal file tree.

virtual FArchive& operator<<(FSoftObjectPath& Value) override;
virtual FArchive& operator<<(FSoftObjectPtr& Value) override;
virtual FArchive& operator<<(struct FWeakObjectPtr& Value) override;

Can anyone help me figure out what the problem is?

3 Likes

I have a very similar issue with UE5 Preview and Visual Studio 2022. Create new Blank (C++) game. This fires up Visual Studio 2022 and sets up the solution. Create new C++ Character class. Same errors arising from CoreNet.h (lines 360-363) with a few additional thrown in as well (Texture.h). This also happens even when creating an empty class with just a constructor and destructor.

1 Like

So I found kind-of a solution. I installed Visual Studio Community 2019, and switched to UE5. Problem resolved. I would prefer to use VS2022, but for now, I can wait until Epic gets all the issues ironed out.

I am getting same errors with “declared with override” from CoreNet.h lines 351-353, 373-375, then on line 402 incomplete type is not allowed. I get this error with UE4.27 and UE5 release using VS2022.

1 Like

I have a similar issue with both 4.27 and 5.0. This appears to be an issue with VS22. my solution for now is to use 2019 ( Edit > Editor Preferences > Source Code then select 2019 from the dropdown) and unfortunately the generated files for 22 will not work(they are incompatible) with VS2019, so you will have to either edit them, regenerate them, or start with a fresh project(after you set you IDE to 2019)

2 Likes

Same issue here… there should be a better solution than installing VS2019???

Still no solution after all this time??

Bro, me too.

Bumping this up. Same error in VS 2022.

Same here too.

1 Like

Woh I really really hope this gets fixed. Because my project is decked out on UE5.1. I ran into the same issue… does not matter if your code is blank or not. This error is default in UE5.1 with vis 2022

1 Like

I’m having the same issue using UE 5.1. Have you found any solution?

Still a problem, and I can’t use UE5 because it’s broken for VR games :frowning:

I had the same problem, and I was able to fix it by compiling in the unreal editor instead of from visual studio. The problem only occured for me when I compiled from visual studio after I first initialized my project.
I am not sure if this is the correct solution for most of you and it seems a little silly that no one has replied this to a thread that has been here for so long, but heres how you compile from the unreal editor for those who are new to using unreal so you guys can try it yourselves:

At the top of your project you should see a “toolbar” filled with commands like build and save current. To the right of that, you will see two arrows facing to the right. Click that to expand the toolbar and then you should see the compile command on the dropdown box.

Once again I have no clue if this will work for you guys but if you tried compiling from visual studio without first compiling in the unreal editor, I think its worth a shot. (Visual Studio 22, Unreal Engine 4.27.2)