SFML community forums

Help => General => Topic started by: Raisapius on September 29, 2010, 09:43:35 am

Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Raisapius on September 29, 2010, 09:43:35 am
Whenever I try to run my application from Code::Blocks itself (Run button), it works fine. But whenever I attempt to run it from the folder it's in, I am told that libgcc_s_dw2.dll could not be found.

I'm using gcc 4.4, the one linked from the installation page.

I have read this this thread (http://www.sfml-dev.org/forum/viewtopic.php?t=2812) already. Linking statically with -static-libgcc does nothing. I did read that SFML uses the Dwarf2 version of gcc, but apparently the one linked from the installation page is the SJLJ version.

Is there anything I can do, or will I have to just find and place the DLL in the folder (which doesn't seem like a good idea to me)?
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Spellbreaker on September 30, 2010, 12:39:32 pm
First, you should compile static sfml libs yourself with the compiler you will use for compiling your app.

Second try adding -static-libstdc++ to the linker options.


Greets
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: RickyDev on October 17, 2010, 04:25:51 am
Quote from: "Spellbreaker"
First, you should compile static sfml libs yourself with the compiler you will use for compiling your app.

Second try adding -static-libstdc++ to the linker options.


Greets

I have this same problem, if I only link with -static-libgcc it does nothing
it has to also be linked with -static-libstdc++ to get rid of both DLL dependencies from libgcc_s_dw2-1.dll and libstdc++-6.dll but it makes
the size of the executable increase exponentially,
So my question is. Can I get rid of libgcc_s_dw2-1.dll with out getting rid of libstdc++-6.dll?

Well I sorta can if I link with -static-libgcc alone it adds about 10KB to my executable but it doesn't get rid of the libgcc_s_dw2-1.dll dependency(or the libstdc++-6.dll but w.e).
And code block gives me a weird warning when I only link static with libgcc and not both libgcc and libstdc++.
Quote
||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||Info: resolving std::cout  by linking to __imp___ZSt4cout |
||=== Build finished: 0 errors, 1 warnings ===|


I don't think it has anything to do with SFML libs though

I'm using C::B 10.05 and GCC  4.5
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: purkskis on December 23, 2010, 06:58:44 pm
i have the same problem.. can anyone help?

and why i get this:
Quote

||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||Info: resolving vtable for sf::Sprite by linking to __imp___ZTVN2sf6SpriteE |
||Info: resolving sf::Color::Black     by linking to __imp___ZN2sf5Color5BlackE |
||=== Build finished: 0 errors, 1 warnings ===|
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Laurent on December 23, 2010, 09:29:46 pm
Did you define SFML_DYNAMIC?
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: purkskis on December 23, 2010, 09:42:03 pm
Quote from: "Laurent"
Did you define SFML_DYNAMIC?

yes (http://i55.tinypic.com/9ggin5.png)
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Laurent on December 23, 2010, 09:53:02 pm
You wrote SFML_DINAMIC :lol:
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: purkskis on December 23, 2010, 09:59:53 pm
ouuu..  :oops:   :lol:

but question  how to statically link libgcc_s_dw2-1.dll is still active  :?
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Laurent on December 23, 2010, 10:02:20 pm
-static-libgcc in linker options.
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: purkskis on December 23, 2010, 10:17:08 pm
Quote from: "Laurent"
-static-libgcc in linker options.

it doesnt work
i hope this time there isn't spell mistakes (http://i56.tinypic.com/xeg29w.png)  :lol:
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Laurent on December 23, 2010, 10:33:32 pm
This works for me. If it doesn't for you, try Google to find relevant information.
Title: Code::Blocks on Win7 - libgcc_s_dw2.dll not found.
Post by: Silvah on December 23, 2010, 10:40:21 pm
It works, but not in the way OP wants it to - libgcc is linked statically with the program, but libstdc++ and probably other libraries as well are still linking with it dymamically. Thus, the dynamic one is still required.