Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does windows OS brings some VC++ runtime by default?

I am going to deploy a VC++ application to windows server 2016(datacenter). I am not sure if the OS already has the vc++ runtime I needed, or I have to bring them with my application? Where can I check such information, like the default existed VC++ runtime for different Windows OS version?

like image 306
shenzhuangwudi Avatar asked Feb 23 '26 12:02

shenzhuangwudi


1 Answers

In the distant past (Visual C++ 4 or so), there was an OS C/C++ Runtime (CRT) that caused a lot of DLL Hell.

Visual C++ 2005/2008 used a 'Fusion side-by-side' solution for the (CRT) . This was intended to allow side-by-side application local as well as central servicing, but that turned out to have a lot of it's own problems

Visual C++ 2010, 2012, and 2013 had a simple 'install to the System32 folder' system-wide -or- 'place it side-by-side' application local style. If you use application local, then it's basically up to the application developers to update the copy they use for servicing.

Visual C++ 2015 is similar to the VS 2010/2012/2013 story, except that the C/C++ Runtime itself been refactored.

  • A core part of the C Runtime is part of the OS as of Windows 10--with a downlevel version for older OSes handled as part of the VCREDIST packages--that is serviced via Windows Update. This is UCRTBASE.DLL which is referred to as the Universal CRT.

  • The Visual C/C++ Runtime is deployed just as it was with the VS 2012/2013 story. It relies on the UCRTBASE.DLL. The Visual C++/C++ Runtime is tied to the specific release you are using of Visual C++.

Currently the VS 2015, VS 2017, and VS 2019 CRT are binary compatible so you can mix code built with all three toolsets but you need to be linking against the newer Visual C/C++ Runtime library for everything to work.

See Microsoft Docs

Note that one of the things the Universal Windows Platform (UWP) model takes care of for you is deploying the right copy of the Visual C/C++ Runtime via the Store. This is not so much 'included with the OS' as it is 'handled transparently on behalf of Windows Store apps'.

UPDATE: The binary compatible promise goes from VS 2015 Update 3 to VS 2022. Note that you are required to do the link with the newest toolset for this to work, and of course redistribute the newest version of the runtime DLLs.

like image 55
Chuck Walbourn Avatar answered Feb 25 '26 00:02

Chuck Walbourn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!