程序找不到libgcc_s_dw2-1.dll [英] Program can't find libgcc_s_dw2-1.dll

查看:2656
本文介绍了程序找不到libgcc_s_dw2-1.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

程序无法启动,因为libgcc_s_dw2-1.dll丢失

我使用Code :: Blocks和MinGW 4.4(我想)编译器来创建一个C ++项目。我得到这个系统错误,如果我从它的目录,但不是从Code :: Blocks中运行它。

I'm using Code::Blocks and MinGW 4.4 (I think) compiler to create a C++ project. I get this system error if I run it from its directory, but not from within Code::Blocks.

The program can't start because libgcc_s_dw2-1.dll is missing from your computer.  Try reinstalling the program to fix this problem.

这篇文章 hardmath说添加 -static-libgcc 到编译器标志,静态链接到dll。当我尝试这个错误仍然发生。我可以通过添加MinGW bin目录到我的计算机的Path变量来工作,但我计划在互联网上分发我的程序。

In this post hardmath said to add -static-libgcc to the compiler flags, linking to the dll statically. When I tried this the error still occurred. I could get it to work by adding the MinGW bin directory to my computer's Path variable, but I plan on distributing my program across the internet.

这个问题只有更新后才出现到最新的G ++编译器。

The issue only appeared after updating to the latest G++ compiler. What's the reason for this solution working for everyone else apart from me?

推荐答案

链接命令行参数 - static-libgcc 应该工作。你可以尝试的另一个变种是简单 -static

The link commandline argument -static-libgcc should work. Another variant you could try is plain -static.

如果你不想担心这个,仍然想重新分配您的二进制文件,只需从MinGW的bin目录中复制相关的dll,并将其放在可执行文件的旁边。这是常见的做法,并按广告的方式进行。

If you don't want to worry about this, and still want to redistribute your binary, just copy the relevant dll from MinGW's bin directory and place it alongside your executable. This is common practice and works as advertised.

这篇关于程序找不到libgcc_s_dw2-1.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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