Windows: build.rs doesn't link advapi32, which the NGX static library needs (LNK2019 __imp_RegCloseKey)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- build-system
Research direction
Read the Windows branch of build.rs and check how it emits linker directives for the NGX static library. Add the advapi32 link directive there, then run the crate's Windows MSVC test binaries with cargo test; done means they link without the unresolved RegCloseKey error.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 60
- Forks
- 18
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bevyengine/dlss_wgpu
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
bevyengine/dlss_wgpu#40 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
bevyengine/dlss_wgpu#25 · 1 comment ·
All issues in bevyengine/dlss_wgpu
Similar issues
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days