Unreal "UnrealBuildTool ... error" compiling in CI
UnrealBuildTool compiles your C++ target. When it reports an error, the cause is a compile failure, a missing module in the build dependencies, or a compiler/toolchain that does not match the engine version.
What this error means
The build fails with "UnrealBuildTool ... error" or "ERROR: UnrealBuildTool failed", with C++ errors or unresolved symbols earlier in the log.
MyGame.cpp(42): error: use of undeclared identifier 'FFoo'
ERROR: UnrealBuildTool exited with code 6
ERROR: Failed to build target.Common causes
A C++ compile error in the target
Code that builds on a developer machine can fail in CI when an include, a module, or a platform define differs.
A toolchain or engine version mismatch
A compiler version the engine does not support, or building against the wrong engine version, makes UBT fail to compile.
How to fix it
Read the first compile error
- Open the first
error:or unresolved symbol above the UBT summary. - Add the missing include or module dependency in the
.Build.cs. - Re-run; UBT exit codes are summaries, not causes.
Match the engine-supported toolchain
Use the compiler/toolchain version the engine documents (or the engine image) so UBT compiles cleanly.
# Build a single target with UBT directly to isolate the error
./Engine/Build/BatchFiles/Linux/Build.sh MyGameEditor Linux Development \
-project="$PWD/MyGame.uproject"How to prevent it
- Declare module dependencies in
.Build.csso headers resolve. - Use the engine-supported compiler/toolchain version.
- Build the target locally with UBT before pushing.