Program Can't Find Libgcc_S_Dw2-1.Dll

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

I believe this is a MinGW/gcc compiler issue, rather than a Microsoft Visual Studio setup.

The libgcc_s_dw2-1.dll should be in the compiler's bin directory. You can add this directory to your PATH environment variable for runtime linking, or you can avoid the problem by adding "-static-libgcc -static-libstdc++" to your compiler flags.

If you plan to distribute the executable, the latter probably makes the most sense. If you only plan to run it on your own machine, the changing the PATH environment variable is an attractive option (keeps down the size of the executable).

Updated:

Based on feedback from Greg Treleaven (see comments below), I'm adding links to:

[Screenshot of Code::Blocks "Project build options"]

[GNU gcc link options]

The latter discussion includes -static-libgcc and -static-libstdc++ linker options.

Can't run executable as libgcc_s_dw2-1.dll is missing

You should copy libgcc_s_dw2-1.dll (it should be located somewhere similar to C:\MinGW\bin or C:\Program Files\CodeBlocks\MinGW\bin) into the same folder as the .exe.

Program can't find libgcc_s_dw2-1.dll

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.

Where Can I Get libgcc_s_dw2-1.dll?

That file implements the exception handling using DWARF information (new style, versus setjump/longjump or SJLj, the old style.

So you should need it only if your code depends on exceptions of any kind.

If you feel lucky you can grab my own compilation of this file from here.

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

You have compiled and linked a computer program on your computer and distributed it to another. You need to include all the linked in dll's that don't come with Windows.

Find the required dll in your MinGW install and provide it to your friend and have him place it with your executable. There may be others. If MinGW has an ldd utility, you can use it to see what dll's your program links to.



Related Topics



Leave a reply



Submit