How to Properly Configure Visual Studio 2020 for Unreal Engine 5 C++? Persistent Errors (Generate_BODY, Corrupted Binaries, etc.)

Hi UE5 community,

I’ve been struggling to set up Visual Studio 2022 Community (Visual Studio 2022 Community Edition: descargar la versión gratuita más reciente) for Unreal Engine 5 C++ development. Despite reinstalling multiple times and following guides, I keep encountering recurring errors. Could someone clarify the exact components and configurations needed for VS2022 to work seamlessly with UE5?

Issues I’m Facing:

  1. Unrecognized Macros: Errors like Generate_BODY() not being recognized, even in fresh projects.
  2. Corrupted Binaries: Frequent need to delete Binaries/, Intermediate/, and DerivedDataCache folders to rebuild.
  3. Mystery Errors: Hundreds of compilation errors (e.g., missing headers, syntax issues) despite code being correct (verified with working projects).

What I’ve Tried:

  • Installed VS2022 with these workloads:
    • “Game development with C++”
    • “Desktop development with C++” (including all C++ tools, Windows 10/11 SDK).
  • Updated to the latest UE5 version (5.5.4).
  • Set VS2022 as the default compiler in UE5 Editor.
  • Ran UE5 as admin and ensured no antivirus blocking file writes.

Questions:

  1. Are there specific VS2022 components (individual checkboxes) required for UE5 that I might have missed?
  2. Could this relate to the Unreal Header Tool (UHT) not running properly? How do I diagnose this?
  3. Are there known conflicts between UE5 and VS2022 updates?
  4. Any other troubleshooting steps (e.g., environment variables, project file regeneration)?

System Specs:

  • Windows 11 24H2
  • Visual Studio 2022 Community 2022 (v17.13.3)
  • UE5.5.4

Thank you for any guidance! I’ve hit a wall after days of trial and error.

If you set up VS as described in their documentation you should be good. Setting Up Visual Studio Development Environment for C++ Projects in Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community

Where are you getting the errors and when?

Have you added any code? (I imagine not, just starting out it sounds like)

WHAT IT COULD BE:
In the “Error List” window in Visual Studio, there is a drop down that will say “Build + Intellisense” or something like that. Make sure it’s on “Build Only”

Also, I like to include all the debugging symbols and stuff like that in the engine install as well.

1 Like

(post deleted by author)

It worked for me!! But now I have a problem, it’s not serious because it compiles the same, but I want to avoid problems in the future: How do I install MSVC v14.38.33130? Visual Studio says it’s better, but I’ve already activated: " *
:white_check_mark: MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.43-17.13)
:white_check_mark: MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (v14.43-17.13).
And it doesn’t appear as used…how do I install or activate it? Thanks!