Skip to content

Commit 3b4caf0

Browse files
committed
Add build.rs to link rstrtmgr on Windows
DuckDB 1.4+ uses the Windows Restart Manager API (RmStartSession, etc.) which requires linking against rstrtmgr.lib. Without this, Windows builds fail with LNK2019 unresolved externals.
1 parent 574c0ab commit 3b4caf0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
// DuckDB 1.4+ uses the Windows Restart Manager API, which lives in rstrtmgr.lib.
3+
// Without this, linking fails with unresolved symbols for RmStartSession, etc.
4+
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
5+
println!("cargo:rustc-link-lib=rstrtmgr");
6+
}
7+
}

0 commit comments

Comments
 (0)