Download

Compilation error with Clang 13 in Windows

I am trying to use Clang 13 in Windows with Visual studio 2019 tool kit to build the Unreal Engine. However I am getting the following linker error

Module.OpenCVLensDistortion.cpp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) public: void __cdecl FRHICommandSetShaderParameter::Execute(class FRHICommandListBase &)” (_imp?Execute@?$FRHICommandSetShaderParameter@VFRHIGraphicsShader@@@@QEAAXAEAVFRHICommandListBase@@@Z) referenced in function “public: virtual void __cdecl FRHICommand<struct FRHICommandSetShaderParameter,struct FRHICommandSetShaderParameterString>::ExecuteAndDestruct(class FRHICommandListBase &,struct FRHICommandListDebugContext &)” (?ExecuteAndDestruct@?$FRHICommand@U?

I get the same error when I tried to use VS 17 and VS 22 tool kit as well.
I am trying to force the project to use clang with the following change
diff --git a/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/UEBuildWindows.cs b/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/UEBuildWindows.cs
index 620a4e6d8b8…bca6259749f 100644
— a/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/UEBuildWindows.cs
+++ b/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/UEBuildWindows.cs
@@ -783,6 +783,8 @@ namespace UnrealBuildTool
///
public override void ValidateTarget(TargetRules Target)
{
+

  •                   Target.WindowsPlatform.Compiler = WindowsCompiler.Clang;
    

Do you have any suggestions to mitigate the error. I am interested in building UE4 with Clang