Rider cannot resolve the DirectX symbol in Unreal Engine 5.2 .Build.cs files
Problem
In an Unreal Engine 5.2 project installed from the Epic Games Launcher, Rider and ReSharper C++ show these errors:
- The Engine folder in the Explorer tool window is underlined with a red squiggle, and the underlined nodes lead to several
.Build.csfiles. - The
.Build.csfiles, for exampleEngine/Source/Developer/Windows/ShaderFormatD3D/ShaderFormatD3D.Build.cs, showCannot resolve symbol 'DirectX'. - The Problems tool window lists the same
Cannot resolve symbol 'DirectX'errors.
The project still builds. The bug is tracked in RSCPP-34310.
Cause
The Unreal Engine 5.2 installation from the Epic Games Launcher does not include the file Engine/Source/ThirdParty/Windows/DirectX/DirectX.Build.cs. The file is present in the Unreal Engine source repository on GitHub. Without it, the DirectX module cannot be resolved.
This is an Unreal Engine bug. According to RSCPP-34310, the launcher installation of Unreal Engine 5.3 includes the file.
Resolution
Upgrade the project to Unreal Engine 5.3 or later.
To stay on Unreal Engine 5.2, add the missing file:
- Download DirectX.Build.cs from the
5.2branch of the Unreal Engine repository. The repository is private, so the link opens only for a GitHub account linked to an Epic Games account. - Copy the file to
Engine/Source/ThirdParty/Windows/DirectX/in the Unreal Engine installation folder, for exampleC:\Program Files\Epic Games\UE_5.2\Engine\Source\ThirdParty\Windows\DirectX\. - Regenerate the project files, then reopen the project in Rider.
The errors also appear only when Solution-Wide Error Analysis (SWEA) is on. SWEA works only in C# and Visual Basic, so turning it off does not affect C++ code analysis. To turn it off, go to Settings | Editor | Inspection Settings and clear Enable solution-wide analysis. For details, see Solution-wide analysis.
Please sign in to leave a comment.