New C++ template gives errors in UE5.1

Hello, I am new with C++ and programming for Unreal Engine. I use Visual Studio 2022. Whenever I create a template, it gives me errors at the complete beginning of the project.
Is it a problem of Microsoft? I’ve seen that I should use VS2019, but I can’t find a community VS2019, it gives me errors on Microsoft page, like I don’t have access to download it because of my subscription.
I would prefer to use VS2022 if possible. I would appreciate your advices and help :slight_smile:
Errors:

Severity Code Description Project File Line Suppression State
Error (active) E1455 member function declared with ‘override’ does not override a base class member Test2 C:\3D\Software\UE_5.1\Engine\Source\Runtime\CoreUObject\Public\UObject\CoreNet.h 381
Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier FRHIViewableResource is undefined Test2 C:\3D\Software\UE_5.1\Engine\Source\Runtime\RHI\Public\RHI.h 2233
Severity Code Description Project File Line Suppression State
Error (active) E1835 attribute deprecated does not apply here Test2 C:\3D\Software\UE_5.1\Engine\Source\Runtime\CoreUObject\Public\Serialization\BulkData.h 283

Kind Regards,
Tim

Hello Timmy_Sib, I do not advise you to create a template from Visual Studio. Instead, create your class from the editor and open your project by double clicking on it.

Sorry, my bad. I meant I am creating a template in UE5.1 as usual, but once I open VS for the first time with the project, I receive dozens of errors.

2 Likes

I have the exact same error message and problems. Did you find any solution?

4 Likes

Have you tried it with Visual Studio 2019? I personally never work with the 2022 version.

I heard that it might be a solution, it’s just my free subscription on Microsoft doesn’t allow me to download a Community Version for some reason.
Could anyone try it please?

As a friend of mine told me, we shall use “Build Only” instead of “Build + IntelliSense”.

“IntelliSense is a helper for issues that it finds with the code. For example, if you’re writing in C++ and misspell a variable, it will underline it in red for you. Sometimes IntelliSense is wrong (especially with Unreal), because things are more complicated and use a lot of Unreal’s logic for things. It is often best to ignore it for errors when using Unreal.” - Shawnthebro

5 Likes

This fixed everything except the last error:
Error MSB3073 The command “D:\UE_5.1\Engine\Build\BatchFiles\Build.bat TUT02Editor Win64 Development -Project=“C:\Users\andre\Documents\Unreal Projects\TUT02\TUT02.uproject” -WaitMutex -FromMsBuild” exited with code 6. TUT02 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 45

any ideas how to fix this?

As others have indicated intellisense often provides red herrings with Unreal build compiler errors. But the console error “code 6” just means the build failed. In my case I tried to do some fancy stuff with C++ 20 concepts (since UE 5 with VS2022 supports the C++ 20 standard) and templates and default template types with decltype and it was just too much for the MSVC VS 2022 compiler. Usually the console log shows the true error but in my case I think the compiler process ran out of memory as there was no other compiler error output in the console but I quickly got back to a working state by commenting out the new code and trying to rebuild again.

To reiterate for those that find this thread in the future: these messages are red herrings. In the dropdown at the top of the Error List tab/pane, select “Build Only” to hide them
image

For me, the actual issue was Live Coding was active, indicated by this message in the output tab. The fix was to do exactly what it says, quit unreal engine or use ctrl+alt+F11

4 Likes

Thanks for the solution. I exited unreal engine and the build works in Microsoft Visual Studio Community 2022. Is there a way to disable Live Coding? or what’s the preferred way to compile? From the log, looks like Live Coding is just compiling in command line.

You can disable live coding in Editor Preferences > General > Live Coding . section.

Reference: Using Live Coding to recompile Unreal Engine Applications at Runtime | Unreal Engine 5.0 Documentation

1 Like

Disabling Live Coding Worked for my project. You can disable it by clicking the button menu (The 3 vertical dots) beside the Live Coding button located in the Bottom Right hand corner of the engine. If you can’t open your project engine, delete .vsconfig, saved, intermediate and Binaries in your project folder. Double click your UProject in that folder and click Yes to rebuild. Then disable Live Coding and open your IDE in the tools menu of the engine.

1 Like

it has worked for me