Windows: build.rs doesn't link advapi32, which the NGX static library needs (LNK2019 __imp_RegCloseKey)
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- build-system
调研方向
阅读 build.rs 的 Windows 分支,检查它如何为 NGX 静态库发出链接器指令。在那里添加 advapi32 链接指令,然后使用 cargo test 运行 crate 的 Windows MSVC 测试二进制文件;当它们链接时不再出现未解析的 RegCloseKey 错误,即表示完成。
由索引模型根据 Issue 内容生成。
描述
On Windows, build.rs links NGX's static library (nvsdk_ngx_d.lib or nvsdk_ngx_s.lib). That library reads the registry: NGXGetPathFromRegistry calls RegOpenKey… and RegCloseKey, which come from advapi32. build.rs doesn't emit cargo:rustc-link-lib=advapi32, so a final binary that doesn't get advapi32 from some other dependency fails to link:
error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function NGXGetPathFromRegistry
We hit this in a crate's test binaries (cargo test of a library that depends on dlss_wgpu with no other advapi32 user). Larger binaries usually pick up advapi32 from std or another -sys crate, which hides the gap.
Environment: dlss_wgpu 6.0.0, DLSS SDK 310.9.1, x86_64-pc-windows-msvc, MSVC 2022 linker.
Suggested fix: in the Windows branch of build.rs:
println!("cargo:rustc-link-lib=advapi32");
Workaround: a downstream build.rs that emits the same line when targeting Windows.
- 主要语言
- Rust
- 星标
- 60
- 派生
- 18
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bevyengine/dlss_wgpu 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 73/100
bevyengine/dlss_wgpu#40 ·
-
难度 4/5 3-5 天 新手友好度 45/100
bevyengine/dlss_wgpu#25 · 1 条评论 ·
查看 bevyengine/dlss_wgpu 的全部 Issue
相似的 Issue
-
go good first issue test
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
bug triaged tui ux wontfix
难度 2/5 半天 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
bevyengine/bevy#26642 ·
维护者通常 2 天内回复