You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

编译NvRTX焦散分支Unreal Engine后缺失dxgi.lib求助

Fixing "cannot open input file 'dxgi.lib'" when compiling NVIDIA NvRTX_Caustics Unreal Engine Branch

I’ve run into nearly identical third-party library path issues when compiling custom UE branches before—those vague "unresolvable library" warnings almost always point to a broken path reference or missing files. Here are actionable steps to fix the dxgi.lib error:

1. Verify Third-Party DirectX Library Completeness

The NVIDIA branch might not include the full DirectX third-party files (common if submodules weren’t cloned properly, or the repo uses .gitignore to exclude large precompiled libs).

  • First, check if the path ThirdParty/Windows/DirectX/Lib/x64/ actually exists in your cloned engine directory. If it’s missing or empty:
    • Re-clone the repo with submodule support using git clone --recursive https://github.com/NvRTX/UnrealEngine/tree/NvRTX_Caustics
    • Or, copy the complete DirectX Lib folder from a working Unreal Engine source build (official 4.x branch matching the NVIDIA branch’s base version) into the corresponding ThirdParty directory.

2. Fix Library Path References in the DX11 Module

The warning message hints that the DX11 module is using an unqualified path for dxgi.lib. Let’s update the build configuration:

  • Navigate to Engine/Source/Runtime/DX11/DX11.build.cs
  • Modify the library reference to use absolute paths via UE’s built-in directory variables:
    // Replace any hardcoded relative paths with this
    string DirectXLibDir = Path.Combine(EngineDirectory, "ThirdParty", "Windows", "DirectX", "Lib", "x64");
    PublicAdditionalLibraries.Add(Path.Combine(DirectXLibDir, "dxgi.lib"));
    
  • Alternatively, to suppress the warning and use system-style path searching, add the directory to PublicSystemLibraryPaths:
    PublicSystemLibraryPaths.Add(Path.Combine(EngineDirectory, "ThirdParty", "Windows", "DirectX", "Lib", "x64"));
    // Then just reference the library name without the full path
    PublicAdditionalLibraries.Add("dxgi.lib");
    

3. Manually Add the Path to Visual Studio’s Linker Configuration

If the project generation script doesn’t pick up the path correctly, manually add it to your VS project:

  • Open the UE4Editor solution in Visual Studio 2017
  • Right-click the DX11 module project (under the Runtime folder) → Properties
  • Go to Linker > General > Additional Library Directories
  • Add the path $(EngineDir)/ThirdParty/Windows/DirectX/Lib/x64 and click OK

4. Clean and Regenerate Project Files

Cached build artifacts or outdated project files often cause these issues. Do a full clean:

  • Delete the Engine/Binaries and Engine/Intermediate folders
  • Run Engine/Build/BatchFiles/GenerateProjectFiles.bat to regenerate the VS solution
  • Do a Clean Solution in Visual Studio, then rebuild the entire engine from scratch (skip incremental builds for this fix)

内容的提问来源于stack exchange,提问作者Bachalo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:01:07