在不安装 Visual C++ Redistributable Package 的情况下运行 Visual Studio 2015 C++ 可执行文件 [英] Running a Visual Studio 2015 C++ Executable Without Installing the Visual C++ Redistributable Packages

查看:29
本文介绍了在不安装 Visual C++ Redistributable Package 的情况下运行 Visual Studio 2015 C++ 可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简短版本:是否可以在不安装 Visual C++ Redistributable Packages 的情况下运行使用 Visual Studio 2015 编译的可执行文件,而是将运行时 DLL 复制到与可执行文件相同的文件夹中?

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?

长版...

自 1990 年代中期以来,我使用 Visual C++ 和后来的 Visual Studio 编写了小程序.直到 Visual Studio 2013,只要我将 msvcpXXX.dll 和 msvcrXXX.dll 放在同一目录中,我就一直能够在任何 Windows 主机上运行这些程序.我从来不需要安装 Visual C++ Redistributable Packages.

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.

现在使用 Visual Studio 2015,这似乎不再起作用.首先没有 msvcrXXX.dll.所以我复制了 msvcp140.dll 和我在 Visual Studio 文件夹 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT (concrt140.dll, vccorlib140.dll, vcruntime140.dll).仍然没有运行.

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.

查看depends.exe 让我觉得有很多依赖项在这些DLL 中没有得到解决.我承认我有点不知所措,并没有继续自己挖掘以找出满足依赖关系所需的每个 DLL.但它开始感觉很糟糕,因为其中许多安装在 C:\Windows 下,而不存在于我的 Visual Studio 可再发行文件夹中.

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?

推荐答案

这出人意料地没有作为重复项关闭.我讨厌留下悬而未决的问题.所以我会自己回答说 codestation 的评论链接到 这个问题 链接到这篇文章 在以粗体红色文本开头的部分中描述了如何执行此操作.

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.

这篇关于在不安装 Visual C++ Redistributable Package 的情况下运行 Visual Studio 2015 C++ 可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆