-
-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows vendored
doesn't statically link
#1398
Comments
I can reproduce this locally, and it looks like the linker is preferring to link to a dynamically linked OpenSSL in PATH (coming from Strawberry Perl) to the statically built one. I'm not familiar enough with MSVC to know if that's expected or not though. |
I've run a
Looking through the code doesn't look like it's impacting? |
The difference won't be in the arguments passed to rustc, it will be in the behavior of the linker rustc invokes (link.exe vs cc) |
Seems I found the culprit. |
Am using the
vendored
flag in my project on windows (rust 1.48 stable-x86_64-pc-windows-msvc) and I can't get to statically link the compiled library (doc says that "If the vendored Cargo feature is enabled, the openssl-src crate will be used to compile and statically link to a copy of OpenSSL.").My cargo toml declares:
When I
cargo run
my app crashes withexit code: 0xc0000135, STATUS_DLL_NOT_FOUND.
; a quick check with a dependency checker reveals in fact that the app needs thelibcrypto-1_1-x64.dll
andlibssl-1_1-x64.dll
. Both get properly build undertarget/debug/build/openssl-sys
, I can see both the.dll
and.lib
files, but the libs don't get linked to the executable.(Note I did use successfully in the past the openssl-sys method, using vcpkg, but I wanted to change to vendored so I could link to the latest version of openssl as I can control my build, but I can't control the installation on the destination system)
The output log from
openssl-sys
has this at the endbut they don't look like they are picked by cargo. Any idea what I should be looking for?
The text was updated successfully, but these errors were encountered: