Hello,
I am using d3d11 libraries and PrivateIncludePaths seems not to work in the Build.cs because when I call #include for those headers I have to write full paths.
I solved this problem replacing engine_path+“Source/Runtime/Windows/D3D11RHI/Public/” by “…/…/…/…/…/Epic Games/UE_4.24/Engine/Source/Runtime/Windows/D3D11RHI/Private/”.
But now i Included D3D11RHIPrivate.h and got
Error C4668 ‘NV_AFTERMATH’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif’ SceneTest D:\RTR\UNREAL\Epic Games\UE_4.24\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11RHIPrivate.h 37.
Error C4668 ‘INTEL_METRICSDISCOVERY’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif’ SceneTest D:\RTR\UNREAL\Epic Games\UE_4.24\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11RHIPrivate.h 44.
@chomusuke2521
You need .build.cs like below one to use D3D11RHI properly:
// Some copyright should be here...
using System.IO;
using System.Collections.Generic;
using Tools.DotNETCommon;
namespace UnrealBuildTool.Rules
{
public class TestGPUReadback : ModuleRules
{
public TestGPUReadback(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string] {
// ... add public include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"RHI",
"RenderCore",
"D3D11RHI"
// ... add private dependencies that you statically link with here ...
}
);
var EngineDir = Path.GetFullPath(Target.RelativeEnginePath);
PrivateIncludePaths.AddRange(new string]
{
Path.Combine(EngineDir, "Source/Runtime/Windows/D3D11RHI/Private"),
Path.Combine(EngineDir, "Source/Runtime/Windows/D3D11RHI/Private/Windows"),
});
// required by D3D11RHI
AddEngineThirdPartyPrivateStaticDependencies(Target, "IntelMetricsDiscovery");
AddEngineThirdPartyPrivateStaticDependencies(Target, "IntelExtensionsFramework");
AddEngineThirdPartyPrivateStaticDependencies(Target, "NVAftermath");
DynamicallyLoadedModuleNames.AddRange(
new string]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
}