5 ms·
>Windows users will need to ensure they have the Visual C++ 2015 Runtime installed. Why?
by 0x4a42 9y ago
>Windows users will need to ensure they have the Visual C++ 2015 Runtime installed.
Why?
- kbrosnan 9y ago> I'm not sure how easy this is to resolve in Appveyor, but I would also prefer to have Windows binaries compiled statically. I'm much less familiar with compiling Rust binaries on Windows and don't have a Windows machine readily available, so I'll have to fire up a virtual machine and experiment. > Worst case scenario, I'll need to add an instruction for Windows users to install the Visual C++ 2015 runtime. I'd prefer to avoid that though. This also likely won't be a problem with the GCC-compiled version, but this runtime is a dependency for all programs compiled by MSVC. https://github.com/shssoichiro/oxipng/issues/49 https://github.com/shssoichiro/oxipng/issues/49
- userbinator 9y agoYou should be able to link with MSVCRT.DLL, yielding a small binary that will "just work" on a variety of systems going all the way back to Win95(!) (provided you don't use newer API calls): https://stackoverflow.com/questions/10166412/how-to-link-against-msvcrt-dll-instead-of-msvcr100-dll-in-vc-10-0 https://stackoverflow.com/questions/10166412/how-to-link-aga... Microsoft doesn't seem to like this, and will say it's "officially not supported" (if I remember correctly, there's a very strongly worded post by Raymond Chen on the topic...), but this is how essentially all the apps that come with Windows are compiled, and I believe MingW does it too. http://planet.jboss.org/post/fighting_the_msvcrt_dll_hell http://planet.jboss.org/post/fighting_the_msvcrt_dll_hell
- nightcracker 9y agoMicrosoft's the one to blame here. If they made sure their systems automatically come with MSVCRTs pre-installed, and new ones downloaded through the update system, this problem wouldn't exist in the first place. Asking your users to install some sketchy 'runtime' won't work. And not every app should need or want a specific install script to verify for the umpteenth time that something as basic as the C/C++ runtime library is available.
- cesarb 9y agoAFAIK, you are supposed to distribute the MSVC runtimes as merge modules within your MSI package, which is what for instance LibreOffice does.
- Const-me 9y ago> you are supposed to distribute the MSVC runtimes as merge modules Right, that’s what MS tell. What they don’t tell is these merge modules aren’t compatible enough. E.g. it’s impossible to install VC 2015 runtime DLLs (so-called Universal CRT) on a never updated Windows 7 SP1 machine.
- pjmlp 9y agoWell my work laptop is Windows 7 up to date, with VS 2015 Update 3. So it got installed there somehow.
- Const-me 9y agoThe problem only affects PCs that aren’t up to date. Specifically, PCs without KB2999226 installed. Not all people update their Windows. Some just don’t care. Others people don’t want to connect PC to the internet. There’re also people who use mobile internet and pay for bandwidth. When they’re unable to run the software they’ve paid money for, I don’t want to update Windows for them, I want my software to work. Hence, no dynamic CRT.
- cesarb 9y ago> Not all people update their Windows. Some just don’t care. Others people don’t want to connect PC to the internet. There’re also people who use mobile internet and pay for bandwidth. And sometimes Windows Update simply stops working. I've seen it happen more than once.
- hypervis0r 9y agoSo you're refusing to have a basic update installed? Let me guess, you're going to complain and say Windows is insecure because you got WannaCry'd because you didn't update your system and blame it on MS instead? (you = whoever "doesn't care" about updates)
- connorcpu 9y agoYou can actually just compile by setting $env:RUSTFLAGS="-C target-feature=+crt-static" and it will completely drop the dependency on vcruntime.dll. Rust is basically only pulling in memcpy/memset/etc. Not really things you'd be worried about statically linking.