Where Can I Get libgcc_s_dw2-1.dll?
Asked Answered
U

2

6

The programme I have written uses SFML but fails when run because libgcc_s_dw2-1.dll is missing. I'm using tdm-gcc and can't find the file anywhere on my computer and re-install doesn't help and a simple hello world programm works fine so I'm not sure why it needs this dll.

Which mingw package can this be found in? I've had a search on the site but cant find it. Apologies if I have just missed an obvious search result but this is incredibly frustrating! Thanks in advance, ell.

P.S. I'm on 64-bit Windows 7 by the way

EDIT: Sorry I forgot to mention I had already read the answer to another question with the same problem, but as I have said, I cannot find the file anywhere on my computer, in the bin directory or otherwise. Also, passing -static-libgcc and -static-libstdc++ to the compiler and/or linker gives me unrecognized option '-static-libstdc++'. Sorry for not clarifying that I have read this already. Thank you!

Udometer answered 17/2, 2012 at 14:44 Comment(0)
N
4

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.

Neva answered 17/2, 2012 at 19:41 Comment(5)
Thank you! Do you happen to know where you got that .dll from?Udometer
@Udometer - Actually I compiled the whole MinGW myself from sources! Cross-compiled from a Ubuntu box. Tricky task, and very instructive. I've been thinking about writing a blog-post about it, but never got enough determination...Neva
wow that does sound tricky! If you do end up writing a blog post about it, do inform me so I can do it!Udometer
Unfortunately that gave me The procedure entry point __gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll. That was the same error when I copied the dll from pre-build MinGW.Bartender
You can find the same file in mingw-w64-i686-gcc-libs.Chansoo
H
4

I believe this is a tdm/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.

Hulda answered 17/2, 2012 at 14:49 Comment(1)
I think linking to the other question is more appropriate than just copying and pasting, especially if edits are based upon comments which haven't been made are present. Thank you anyway thoughUdometer
N
4

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.

Neva answered 17/2, 2012 at 19:41 Comment(5)
Thank you! Do you happen to know where you got that .dll from?Udometer
@Udometer - Actually I compiled the whole MinGW myself from sources! Cross-compiled from a Ubuntu box. Tricky task, and very instructive. I've been thinking about writing a blog-post about it, but never got enough determination...Neva
wow that does sound tricky! If you do end up writing a blog post about it, do inform me so I can do it!Udometer
Unfortunately that gave me The procedure entry point __gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll. That was the same error when I copied the dll from pre-build MinGW.Bartender
You can find the same file in mingw-w64-i686-gcc-libs.Chansoo

© 2022 - 2024 — McMap. All rights reserved.