9 ms·
>So why can't Visual Studio compile to something that works by default on the Windows of the target audience without requiring them to install those additional
by garaetjjte 5y ago
>So why can't Visual Studio compile to something that works by default on the Windows of the target audience without requiring them to install those additional DLLs?
Since Windows 10 it ships with Universal C Runtime, which is used by VS2015+. System software uses these runtimes too. For Win7+ it was added as system update, though MS later relented and said it was fine to copy-paste all the api-ms* libraries from the SDK into your application directory so it also works on outdated installations.
In the past it was different though, as system software was compiled against MSVCRT.DLL, but you wasn't supposed to use it and instead use version specific DLLs shipped in "Visual C++ Redistributables". Though going back to Windows 9x there was a time when MSVCRT.DLL was the library that was supposed to be used by applications. See http://bytepointer.com/resources/old_new_thing/20140411_092_windows_is_not_a_microsoft_visual_c_c_run_time_delivery_channel.htm http://bytepointer.com/resources/old_new_thing/20140411_092_...
- bni 5y ago"Windows 10 it ships with Universal C Runtime", really? Is this a different thing than vc_redist? Games still require vc_redist.x86.exe or vc_redist.x64.exe to be installed, even on Windows 10. Ancient games also require ancient versions of these to be installed. I have always found it very strange that these wasnt just included in Windows.
- Diggsey 5y agoThere are two "components" to what used to be `msvcrt.lib`: - The C runtime library (now `ucrt.lib` AKA the universal C runtime) - The compiler runtime (now `vcruntime.lib`) The former has a stable API, but the latter doesn't - it changes from one compiler version to the next, as it is used to support various C++ language features. When these two were combined as `msvcrt.lib`, there was no way for windows to ship it with the OS, because it changed with each VC++ version - they could have shipped historical versions, but it wouldn't really help developers who can't guarantee that the the OS version used by their users is newer than their version of VC++. Now that these two are split, microsoft can ship the stable universal C runtime with the OS, and programs that only rely on the C runtime do not need a redistributable at all. (This makes things easier for other languages like Rust, or things compiled from GCC, which don't need the VC++ runtime). Programs that use the VC++ runtime still need to ship the corresponding `vcruntime`, although you still have plenty of freedom in how you do that (eg. bundle DLLs, statically link, etc.) and the compiler runtime itself is smaller than the whole C runtime library.
- bni 5y agoGreat explanation, thanks!