-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
VCRUNTIME140.dll missing on target machine #100874
Comments
I can't seem to find the .cargo/config file. Would I have to create this.
Also, I would like a proper walk through on staticCRT linking, that article
was not clear to me.
Thank you,
Julia
…On Mon, Aug 22, 2022, 08:58 Christopher Serr ***@***.***> wrote:
Look into crt-static:
https://www.reddit.com/r/rust/comments/ekts0d/how_to_link_crt_statically_when_building_with_msvc/
—
Reply to this email directly, view it on GitHub
<#100874 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2UCSR5KRHOGPM3KZOHPR3DV2N2OXANCNFSM57HLGTWQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If you just want to static link vcruntime (and not the whole CRT), here's a crate for that. It's used from a build script ( Though if you do want to statically link everything then only follow the instructions at the bottom:
|
Hello Chris, How do I fix this please |
It's a bit hard to diagnose with just that error code but you could try doing |
Hello Chris,
It gives that error code and my build fails. It says something about the
MSVC conflicting with the defaultlib:libraries is there any code I ought to
edit before building
…On Mon, Aug 22, 2022, 17:22 Chris Denton ***@***.***> wrote:
It's a bit hard to diagnose with just that error code but you could try
doing cargo clean before rebuilding. Btw here's two "hello world" example
projects:
- example using .cargo/config.toml
<https://github.com/ChrisDenton/static_vcruntime/tree/crtstatic/example>
- example with static_vcruntime
<https://github.com/ChrisDenton/static_vcruntime/tree/main/example>
—
Reply to this email directly, view it on GitHub
<#100874 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2UCSR3X67FJ5L2HJNQAHITV2PVSFANCNFSM57HLGTWQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Do either of the examples work for you? |
Hi Chris, I used the code below in my .cargo/config and when I tried installing on target pc I didn't get any runtime error but my program ceased to install. Now I'm even more confused [target.x86_64-pc-windows-msvc] |
It is very hard to diagnose such issues remotely and with limited information. My best guess is that a dependency of your application is set up for dynamic linking (it would explain the errors you encountered earlier). But that is just a guess. You may need to use a debugger to find out why it isn't working. One other option is to give up trying to statically link and redistribute just the dll in the same folder as your application. You can find the redistributable dll using the "Developer Powershell" that should be in your start menu. Type: Join-Path $env:VCToolsRedistDir x64\Microsoft.VC143.CRT\vcruntime140.dll This will give the path to |
Closing this as it is a user-help issue |
Similar issue here. On a freshly installed Windows Server 2022, our library fails to find |
Sorry i meant to close this :P |
Whenever Itry to run a program compiled in rust on a target machine, it gives me an error code saying VCRUNTIME140.dll missing. How can I avoid this without any extra installations on the target machine
The text was updated successfully, but these errors were encountered: