. Advertisement .
..3..
. Advertisement .
..4..
The error
The program can't start because libgcc_s_dw2-1.dll is missing from your computer.
Try reinstalling the program to fix this problem.
occurred when I run a program in C++ with Code::Blocks by double-clicking on the executable file. I’ve tried to fix it for some days but have not resolved it yet. Can someone suggest a relevant solution to fix the libgcc_s_dw2-1.dll issue? Much appreciate your support.
The cause:
You have got the error ”the libgcc_s_dw2-1.dll” because you did not install “libgcc_s_dw2-1.dll” for your computer, so the program could not work.
Solution:
To solve this problem, you have to set up
libgcc_s_dw2-1.dll
for the bin directory of compiler.You can either fix the issue by adding “-static-libgcc -static-libstdc++” to your compiler parameters or you can supplement this directory into your PATH environment variable for runtime linking.
The latter is generally the most sensible option if you intend to share the executable. The option of altering the PATH environment variable is appealing if you just intend to use it on your personal computer (not change the size of the executable).
You can add links to: based on suggestions from Greg Treleaven.
[Screenshot of Code::Blocks “Project build options”]
[GNU gcc link options]
The linker options
-static-libgcc
and-static-libstdc++
will appear in the latter discussion.It is located in Eclipse under Project Properties > C/C++ Builder > Settings > MinGW ++ Linker > Misc
It must be added to the “linker flags at the top”; it cannot be anywhere else. Next, rebuild.
I’ve found that linking these statically increases the size to up to 1,400kb, even with optimizations. This is 277kb more than just copying the shared DLLs. After UPXing everything, it’s 388kb bigger. This is a very lose/lose situation. You can include DLLs if you have them elsewhere.