运行 在 headers 不存在的计算机上编译的 C 程序

Run a compiled C program on a computer where the headers don't exist

我写了一个包含 Windows.h header 的代码,并使用 Visual Studio.

编译了它

然后我尝试在我的另一台计算机上单独 运行 EXE 文件,它似乎缺少指定的 header。

如何在另一台计算机上 运行 它而无需安装 VS?

可执行文件不需要header。它需要动态库。它们使用 Visual Studio 或 Visual Studio Redistributable Package 进行分发。您可以使用该包分发您的程序。另一种选择——使用静态链接。使用静态链接可执行文件将具有所有需要的数据和代码。