Joe
Joe

Reputation: 63

Why do I need a C++ redistributable for a specific IDE?

When developing in C++, it is frequent for developers to use Visual Studio for Windows development. When setting up the VS IDE, Microsoft provides a set of C++ redistributable that are available for download in order to use Visual Studio. The C++ redistributeable contains .dll for standard librarires such as <stdio>. My question here is, why does Microsoft say on there website that these distributable are "for Visual Studio". What is preventing me for example, downloading the C++ redistributables and using a different IDE, let's suppose Geany and editing the source code elsewhere. All we need is the .dll of the standard libraries, once they're obtained we can edit our source code anywhere we desire?

Upvotes: 0

Views: 785

Answers (2)

Cody Gray
Cody Gray

Reputation: 244782

It has nothing whatsoever to do with the IDE. It's about Microsoft's C++ compiler, which requires a redistributable for the run-time libraries when you use dynamic linking. And the redistributables are version-specific.

A different version of the C++ compiler toolchain is bundled with each new release of the Visual Studio IDE. Unfortunately, the Visual Studio version number is very different from the actual version of the C++ compiler. So, Microsoft has chosen to use the Visual Studio version to label the run-time redistributable, because this version number is much better known. A version number mapping table is maintained in the Wikipedia article ("MSVC++ version" is the version number of Microsoft Visual C++, which is the build toolchain).

You can use any build toolchain you like with the IDE, including non-Microsoft tools, which would require their own run-time redistributables. Similarly, you could invoke Microsoft's build tools from another IDE, in which case, you'd still require Microsoft's redistributables.

Or, you could use static linking to integrate the run-time libraries directly into your executables, in which case you would not require the redistributable at all. But this has the notable downside that your application will not benefit from any security updates to the run-time libraries. You'll need to recompile and redeploy your executable to get those security updates.

Upvotes: 1

Zan Lynx
Zan Lynx

Reputation: 54325

The redistributable packages are not really for the IDE. They are for the compiler. Various version of cl expect particular sets of library support.

So you can use any IDE if it calls the Microsoft cl compiler application and use the packages for that compiler.

Or you can do the opposite and avoid the packages by using mingw / mingw-w64 / MSYS2 which is GCC and other Unix tools compiled against the pre-installed Windows runtime libraries.

Upvotes: 0

Related Questions