UE5.2 Solve the error about DirectX
Preface
After downloading Unreal 5.2 through Launcher, when creating a C++project and opening the project through Rider, the engine project will display an inexplicable red warning. After troubleshooting the project content, it was found that the errors were all caused by the lack of DirectX. Most of the errors are in the Build. cs file. The warning section states that DirectX does not exist, but compiling the project does not have any impact (non source code engineering).
The main purpose of the Build.cs file in the Unreal Engine is to inform UBT of the reference relationship between modules and libraries when building a project. Compilation can be done by stating that the library is not missing, while Rider reports an error indicating that the relationship cannot be found in the context. Compare the local engine code with the official Git source code, mainly checking the Source/ThirdParty/Windows directory. Found that the Build.cs file is missing in the DirectX directory compared to the engine source directory.
Solve Method
1、Download the Build.cs file
Git source download,login your github account,download DirectX.Build.cs
You can also directly copy the code below and create your own Build.cs file
|
|
2、Copy file to the engine path
Copy download file to\Epic Games\UE_5.2\Engine\Source\ThirdParty\Windows\DirectX
3、Refresh solution
Close Rider, refresh the project file in the project, generate a new solution, and then open Rider to wait for the project to refresh. The problem can be resolved.
Conclusion
Maybe this is a bug in the version
Engine Version:5.2