A build failure in Unreal Engine almost always comes from a concrete, reportable cause—the compiler or UnrealBuildTool (UBT) names the file and line where it stopped—so the first step is to read the actual error text rather than assuming "Unreal broke." Unreal has several distinct failure surfaces (C++ compilation by UBT, module and target rules, generated code, linker errors, and packaging), and the fix depends on which one failed. Because no error log, engine version, platform, or project details were supplied, this answer explains the diagnostic workflow and the recurring causes that account for most failures, with the specific thing to check in each case.
Start with the real error, not the popup
The message "The following modules are missing or built with a different engine version" or a generic "Build failed" dialog from the Unreal Editor hides the useful information. The actual error is in one of these places:
Output Log (Window → Output Log) if the build was triggered from the editor. The Visual Studio / Rider "Output" or "Error List" window if launched from the IDE. Saved\Logs\ in the project directory, especially UnrealBuildTool*.txt and the editor log. The console or terminal if you ran Build.bat / RunUAT.bat directly.
The first line that says error—not warning—is the one to chase. Unreal produces cascading noise; a single missing header can generate dozens of downstream errors, and fixing the first true cause often clears all of them. On Windows, a common confusion is that UBT reports a summary count ("N errors") while the editor only shows the summary; the detailed messages are in the log file.
Also confirm what "build" means in your context. There are several operations that people conflate:
| Operation | What runs | Typical failure |
|---|---|---|
| Compile C++ in IDE | MSVC/Clang + UBT | Syntax, includes, API macros |
| Build from editor ("Compile") | Live Coding or full UBT | Live Coding patch rejection, module rules |
| Build/rebuild solution | UBT regenerates and compiles | Target/module configuration |
| Package project | UBT + cook + stage | Missing assets, cook errors, plugins |
| Generate project files | UBT writes .sln/.vcxproj | Project descriptor errors |
Knowing which one you triggered narrows the cause immediately. A "Generate project files" failure is not a compiler failure—it usually means the .uproject or a .Build.cs is malformed.
The most common root causes and how to confirm each
Missing or wrong engine association and version mismatch
If you opened the project with a newer engine than it was built with, or the .uproject's EngineAssociation doesn't match an installed engine, UBT will refuse to build. In the editor this often surfaces as the "modules are missing or built with a different engine version" dialog. Check EngineAssociation in the .uproject (a GUID for source builds, a version string like "5.4" for launcher installs) and confirm that engine is actually installed and registered. A related trap: opening a C++ project that was never compiled on this machine—right-click the .uproject and choose "Generate Visual Studio project files," then build the Development Editor target.
Module and target configuration errors in .Build.cs / .Target.cs
Module rules are C# that UBT evaluates before compiling anything. Errors here are reported as UBT errors, not compiler errors, and often look cryptic. Frequent offenders:
A module listed in PublicDependencyModuleNames or PrivateDependencyModuleNames that doesn't exist or isn't spelled with the exact UE module name (e.g., "EnhancedInput", "UMG", "Slate", "SlateCore"). Referencing a plugin's module without enabling the plugin in the .uproject. A using directive or type from the UnrealBuildTool namespace that changed between engine versions. In *.Target.cs, an invalid DefaultBuildSettings or IncludeOrderVersion for that engine version.
Confirm by reading the UBT log line that names the .Build.cs file and the C# exception; it almost always quotes the offending symbol.
Missing includes, the wrong include order, or the wrong header
Unreal's include rules differ from plain C++. The most common single-source compile error is using a type without including its header, or including it in the wrong order. In modern UE (5.x, with IncludeOrderVersion set appropriately) you generally include the specific header, not a monolithic engine header. A classic example: using UWorld or AActor without including Engine/World.h or GameFramework/Actor.h, or using FVector without Math/Vector.h (often transitively included, which is why it sometimes "works" and sometimes doesn't). The fix is the compiler's own suggestion—it names the incomplete type.
Watch for #include cycles and for putting includes below other declarations; Unreal's generated headers (.generated.h) must be the last include in a header that contains UCLASS/USTRUCT/UENUM macros. If .generated.h isn't last, you get errors about GENERATED_BODY or missing generated symbols.
Unreal Header Tool (UHT) errors: reflection macros
UHT parses headers before compilation. Errors like "Unrecognized type," "Missing 'UCLASS' before class," or "GENERATED_BODY does not match" come from UHT, not the C++ compiler. Common causes:
A UCLASS/USTRUCT/UENUM missing its GENERATED_BODY() (or the older GENERATED_UCLASS_BODY()), or GENERATED_BODY() placed incorrectly. A reflected type used in a UPROPERTY that UHT can't understand—e.g., a raw pointer, a type from a module not listed as a dependency, or a TSubclassOf/TObjectPtr used with an unreflected class. Using a type in a UFUNCTION signature that isn't reflectable (e.g., a std:: type, or a struct lacking USTRUCT). A UENUM used as a bitmask without ENUM_CLASS_FLAGS or the meta = (Bitmask) marker.
Confirm by finding the "UnrealHeaderTool failed" section in the log; it points to the specific header and property.
API export macros across modules
If you split code into your own module or game/plugin pair, you must mark classes and functions with the module's export macro (e.g., MYGAME_API). Symptoms are linker errors: unresolved external symbol for a function that clearly exists in your source. This happens when a class is declared in one module but not exported, or when a header is included but the defining module isn't a dependency. Check that PublicDependencyModuleNames in the consuming module lists the module that owns the symbol.
Linker errors vs. compiler errors
These are different and need different fixes:
Compiler error (C2065, C2143, error: use of undeclared identifier): the source text or includes are wrong. Linker error (LNK2019 unresolved external, LNK2001): the symbol compiled but couldn't be found at link time—missing module dependency, missing export macro, or a function declared but never defined.
A frequent linker cause in UE is defining a function in a .cpp that is declared in a header but never included/compiled into the module (e.g., the .cpp isn't part of the module because it's in the wrong folder, or the module's *.Build.cs excludes it).
Live Coding vs. full rebuild
Unreal 5's Live Coding patches a running editor, but it cannot handle many changes—adding a new UCLASS, changing a class's memory layout, adding new modules, or touching certain headers. When Live Coding refuses or the patch fails, the editor may report a build failure even though a full rebuild would succeed. The tell is a message naming Live Coding or a "patch failed" notice. Close the editor and do a full build (Build → Rebuild, or your IDE's Rebuild) to rule this out. Conversely, a stale full build after header changes may need "Clean" then "Rebuild," because UBT sometimes reuses intermediate files.
Stale generated files and intermediate folders
Corrupted Intermediate/, Binaries/, or .vs/ folders, or a .sln that's out of date, cause "phantom" errors—especially after engine upgrades, moving the project, or switching IDE/platform. The standard remedy, tried after reading the real error, is to close the editor, delete Intermediate/, Binaries/, Saved/ (optional), and .vs/, then regenerate project files and rebuild. This is a repair step, not the first thing to do—it destroys incremental state and can mask the real cause if applied blindly.
Platform, toolchain, and SDK gaps
"Build failed" with no obvious code error often means the platform toolchain isn't installed: missing Windows SDK or MSVC version for the engine version, missing Xcode command-line tools on macOS, or a Linux clang toolchain mismatch. The log will name the missing component (e.g., "Visual Studio 2022 ... is not installed" or "Windows SDK ... not found"). On Windows, the Visual Studio Installer must include the "Game development with C++" workload and the exact MSVC/SDK versions the engine expects; a mismatched minor SDK version can fail to build.
Worked diagnostic sequence
1: Reproduce the failure and capture the full log. Read the first error line. 2: If it's a UBT/target error, inspect .uproject, .Build.cs, .Target.cs and plugin enablement. 3: If it's a UHT error, inspect the named header's reflection macros and .generated.h placement. 4: If it's a compiler error, fix includes and the named undeclared type. 5: If it's a linker error, check export macros and module dependencies. 6: If the log points to Live Coding, close the editor and do a clean full rebuild. 7: Only if the error is ambiguous or clearly stale, delete Intermediate/ and Binaries/, regenerate, and rebuild.
A concrete example of step 2: a project with a plugin module MyPlugin referenced in MyGame.Build.cs but whose plugin isn't enabled in the .uproject will fail at UBT with "Could not find definition for module 'MyPlugin'." The fix is enabling the plugin, not editing C++.
Where this guidance stops
The answer above assumes Unreal Engine's standard C++ build path (UBT + UHT) on a desktop platform. It does not cover blueprint-only projects (which don't compile C++ and fail differently), custom engine source builds with modified UBT, or CI-specific issues like read-only file permissions and missing credentials for remote build machines. Specific error codes, engine version, operating system, and whether the project is a game, plugin, or custom module were not supplied; those details change which of the causes above applies. Without them, the log's first error line remains the only reliable starting point.