Skip to content

windows: Statically link C++ runtime - #377

Merged
JohnAZoidberg merged 1 commit into
mainfrom
windows-static-msvcp
Oct 2, 2026
Merged

JohnAZoidberg merged 1 commit into
mainfrom
windows-static-msvcp

Conversation

@JohnAZoidberg

Copy link
Copy Markdown
Member

Since smartmontools was added, the release binary depends on MSVCP140.dll, which is not present on a clean Windows install.

cc compiles C/C++ dependencies with /MD unless the crt-static target feature is set, which links the C++ STL dynamically. static_vcruntime only changes linker arguments, so it doesn't help there.

Set +crt-static for MSVC targets and add a CI check that the binary doesn't depend on the VC++ redistributable.

Since smartmontools was added, the release binary depends on
MSVCP140.dll, which is not present on a clean Windows install.

cc compiles C/C++ dependencies with /MD unless the crt-static target
feature is set, which links the C++ STL dynamically. static_vcruntime
only changes linker arguments, so it doesn't help there.

Set +crt-static for MSVC targets and add a CI check that the binary
doesn't depend on the VC++ redistributable.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg

Copy link
Copy Markdown
Member Author

uefi error is unrelated to this change. comes from a new rust version

@JohnAZoidberg
JohnAZoidberg merged commit f3e9dfc into main Oct 2, 2026
9 of 11 checks passed
@JohnAZoidberg
JohnAZoidberg deleted the windows-static-msvcp branch October 2, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant