Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a Visual Studio 2015 C++ Executable Without Installing the Visual C++ Redistributable Packages [duplicate]

Short Version: Is it possible to run an executable compiled with Visual Studio 2015 without installing the Visual C++ Redistributable Packages, and instead copying the runtime DLLs into the same folder as your executable?

Long Version...

Since the mid 1990s I have written small programs using Visual C++ and then later Visual Studio. Up until Visual Studio 2013 I have always been able to run these programs on any Windows host as long I put msvcpXXX.dll and msvcrXXX.dll in the same directory. I have never needed to install the Visual C++ Redistributable Packages.

Now with Visual Studio 2015 this appears to no longer work. First there is no msvcrXXX.dll. So I copied msvcp140.dll and three other DLLs I found in the Visual Studio folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT (concrt140.dll, vccorlib140.dll, vcruntime140.dll). Still doesn't run.

Looking at the depends.exe makes me think there are a lot of dependencies that are not resolved in these DLLs. I confess I got a little overwhelmed and didn't keep digging on my own to figure out every DLL I need to have to satisfy the dependencies. But it started feeling very hacky, as many of them were installed under C:\Windows and not present in my Visual Studio redistributable folders.

Anyway, can anyone help?

like image 588
John Fitzpatrick Avatar asked May 27 '16 15:05

John Fitzpatrick


People also ask

Can I delete duplicate Microsoft Visual C++?

No you should not because some apps need old visual c++ redistribute packages for them to work. They are like the libraries of the apps.

Do I need Microsoft Visual C++ 2015 redistributable?

We don't recommend that you delete any Visual C++ redistributable, because doing so could make multiple applications on your computer stop working. Given how little space they take up and how broadly they are used, it doesn't seem worth the hassle to mess with your current ecosystem of standard library files.

How do I fix Microsoft Visual C++ 2015 setup failed 0x80240017?

Update your apps: Some apps on your device might be responsible for the Microsoft Visual C++ Install Error 0x80240017. So, updating those software programs could help resolve this issue. Clean your PC: Sometimes, performing a simple disk clean-up could help remove the system issues that are causing this error.

Can I delete Visual C++ 2015 redistributable?

In the Programs and Features window, scroll down the list of installed programs to the Microsoft Visual C++ Redistributable package, and then right-click it and select Uninstall. Step 3. Click on Yes or Uninstall in the pop-up confirmation window and follow the on-screen prompts to complete the uninstallation.


1 Answers

This was surprisingly not closed as a duplicate. And I hate leaving open questions unanswered. So I'll answer it myself by saying that codestation's comment links to this question which links to this article which describes how to do this in the section that starts with bold red text.

You shouldn't upvote this. Upvote the answer in the linked question.

like image 120
John Fitzpatrick Avatar answered Oct 22 '22 20:10

John Fitzpatrick