【发布时间】:2019-12-27 00:47:26
【问题描述】:
当我编译一个简单的程序时:
#include <iostream>
using namespace std;
void main() {
cout << "Hello world!";
}
在另一个未安装 Visual Studio 的系统上调整编译后的 .exe,我收到以下错误:
The Code execution cannot proceed because VCRUNTIME140.dll was not found. Reinstalling the program may fix the problem.
当我用 cl.exe 编译时,我没有收到任何错误, 有没有人知道在系统上不安装 VCRUNTIME140.dll 的解决方法。 (我已经在多个 Windows 系统上进行了测试,包括一个 Windows 虚拟机)
【问题讨论】:
-
您需要安装 C++ 运行时库。通常 VS 带有可再发行安装程序,但您也可以从他们的网站下载。 Download link。它是必需的,因为任何用 VS 编译的 C 或 C++ 程序都依赖于它们。或者,您也只需复制所有必需的文件。
标签: c++ visual-studio cl