• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Why does software install MS Visual C++ Runtime

Staples

Diamond Member
I have always wondered this. C++ code is fully compiled into machine language and NOT interpreted or compiled into byte code. Or at least that is what I have always been taught so why do some big applications need to install the VC++ runtime?
 
VC++ is Microsoft's implementation of C++ and is not fully standard C++. Basically it's a specialized library that is needed to compile (and in some cases, run) programs made with it.

Personally I don't like using it as it creates an unnecessary dependency. For a large company, development time is more important than the end result, and vc++ / .net does make certain things easier and faster when developing so that's why it's often used.
 
The runtime includes a dynamically linked library (DLL) that contains a lot of fully compiled machine language code that the application binaries link in rather than duplicating such code within their own binaries.

Red Squirrel said it much better and quicker.
 
I have always wondered this. C++ code is fully compiled into machine language and NOT interpreted or compiled into byte code. Or at least that is what I have always been taught so why do some big applications need to install the VC++ runtime?

Well, you have the C++ (or C) programming language itself, and then you have libraries which add functionality for the language. C++ itself doesn't know or care what kind of system it's running on, so the language itself doesn't do anything that might be specific to one platform. Instead it defines libraries to do various things (say, printing text to the screen, or holding certain kinds of data), and while those libraries have the same interface, they are implemented differently depending on the platform where the code is running.

So at some point, the program needs access to the code that implements the library functions. This can be done by static linking (basically, when the program is compiled the library code is copied into the .exe file) or by dynamic linking (when the program runs, it tries to load the code from a .dll file). There are a variety of potential issues with static linking, so MS recommends (and most people use) dynamic linking on Windows.

Edit: To actually answer your original question about why they're always installed by programs... The original theory was that your programs would always automatically use the newest version of a DLL, but the problem is that it's very easy for updates to a DLL to change things and break backwards compatibility. So program 1 might be installed with version 0.1 of foo.dll, but then program 2 is installed with version 0.25 of foo.dll. Now program 1 crashes every time it tries to run, because it doesn't understand the new version of foo.dll. This was known as DLL Hell. Ultimately MS made it possible to have multiple versions of the same library installed. So now, your computer would have both version 0.1 and 0.25 of foo.dll, and each program just uses the appropriate version that it was compiled against.
 
Last edited:
I have always wondered this. C++ code is fully compiled into machine language and NOT interpreted or compiled into byte code. Or at least that is what I have always been taught so why do some big applications need to install the VC++ runtime?

It's compiled but it's not statically compiled so that all of the dependencies are included in the binary.
The C++ runtime is a set of functions common to MS' implementation of C++ so any C++ app needs them. MS has failed pretty hard at library versioning over the years so most apps install the version they were built against just in case the one you have isn't 100% compatible.
 
VC++ is Microsoft's implementation of C++ and is not fully standard C++. Basically it's a specialized library that is needed to compile (and in some cases, run) programs made with it.

Personally I don't like using it as it creates an unnecessary dependency. For a large company, development time is more important than the end result, and vc++ / .net does make certain things easier and faster when developing so that's why it's often used.

Every complete C++ implementation provides a C++ runtime; what do you think GCC's libstdc++ is?

MSVC++ is no less "standard C++" than any other major compiler. Its C++ Standard compliance is excellent, on-par with GCC for C++03 support.
 
Every complete C++ implementation provides a C++ runtime; what do you think GCC's libstdc++ is?

MSVC++ is no less "standard C++" than any other major compiler. Its C++ Standard compliance is excellent, on-par with GCC for C++03 support.

Same problem with linux, only except gcc is a pain in the ass to get libstdc++ to compile statically.
 
Static compile is sometimes the only option when you don't have root access to the cluster of machines you want to run your binary off of.
 
Static compile is sometimes the only option when you don't have root access to the cluster of machines you want to run your binary off of.

You don't need to statically compile for that, you can just include a copy of the library and use the LD_PRELOAD variable to include your copy.

Or you can just link against whatever C++ library is already present on the cluster, which would be the preferred method I would think.
 
Back
Top