Program can't find libgcc_s_dw2-1.dll [duplicate]

久未见 提交于 2019-12-17 07:23:28

问题


Possible Duplicate:
The program can't start because libgcc_s_dw2-1.dll is missing

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.

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.

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?


回答1:


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

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.



来源:https://stackoverflow.com/questions/4984612/program-cant-find-libgcc-s-dw2-1-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!