如何修复其他计算机上的错误 "other computer the program can't start because libgcc_s_dw2-1.dll is missing from your computer"

How to fix error "other computer the program can't start because libgcc_s_dw2-1.dll is missing from your computer" on other computer

我该如何解决其他计算机程序无法启动的问题,因为您的计算机libgcc_s_dw2-1.dll缺少1.dll?电脑编译的程序和电脑运行程序不一样

因为我正在使用 CLion,所以我似乎必须更改 CMake 文件,但我无法从我找到的许多网站获得建议。我应该在我的项目中添加什么?

我看过其他问题How can I install GCC runtime libraries with CMake?,但我不知道这个答案是怎么回事。

您已经在您的计算机上编译并链接了一个计算机程序并将其分发给另一个人。您需要包含 Windows.

未附带的所有链接到 dll 中

在您的 MinGW 安装中找到所需的 dll 并将其提供给您的朋友,让他将其与您的可执行文件放在一起。可能还有其他人。如果 MinGW 有 ldd 实用程序,您可以使用它来查看您的程序链接到什么 dll。