开发者

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

开发者 https://www.devze.com 2023-02-10 18:35 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: The program can't start because libgcc_s_dw2-1.dll is missing
This question already has answers here: Closed 10 years ago.

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 comp开发者_如何学编程uter'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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号