News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

program can't start because libgcc_s_dw2-1.dll is missing from your computer

Started by yuk.f, August 15, 2012, 05:05:46 AM

Previous topic - Next topic

yuk.f

I came across a problem that when I double click on the .exe file to run a demo, it promotes a system error says "The program can't start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem" I have reinstalled the code block(10.05), but the problem still stands. Anybody know something about it?
ps: my env[ Win7 enterprise edition, 64bit ]

Jenna

If it works from inside C::B, but not from outside (explorer or commandline), it means, that the dll can not be found by the system, because it's neither in the search path, nor in the same folder as the exe.

yuk.f

Quote from: jens on August 15, 2012, 06:22:53 AM
If it works from inside C::B, but not from outside (explorer or commandline), it means, that the dll can not be found by the system, because it's neither in the search path, nor in the same folder as the exe.

yes as you said, it works inside the C::B. Even a simple demo "HELLO WORLD" can't exec outside the C::B. Do you have any idea how to fix it? Thanks!

Jenna

Quote from: yuk.f on August 15, 2012, 06:44:48 AM
Quote from: jens on August 15, 2012, 06:22:53 AM
If it works from inside C::B, but not from outside (explorer or commandline), it means, that the dll can not be found by the system, because it's neither in the search path, nor in the same folder as the exe.

yes as you said, it works inside the C::B. Even a simple demo "HELLO WORLD" can't exec outside the C::B. Do you have any idea how to fix it? Thanks!

Saerdus

I had the EXACT same problem when i downloaded some demo projects to experiment with.

If you have the same problem I did there's an easy fix.

Simply open the project with Code::Blocks and build/run the project within Code:Blocks; assuming the code runs smoothly with no errors the .exe should work now.

If not, I'm afraid i don't know what else to suggest as I'm still learning C++ as well.  :)


Alpha

The reason is
Quote from: jens on August 15, 2012, 06:22:53 AM
[...] because it's neither in the search path, nor in the same folder as the exe.
Easiest fix is to simply 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.

Alternatively, add the following two switches to your linker options:
-static-libgcc
-static-libstdc++

m.m.m

Quote from: Alpha on August 23, 2012, 11:19:09 PM
The reason is
Quote from: jens on August 15, 2012, 06:22:53 AM
[...] because it's neither in the search path, nor in the same folder as the exe.
Easiest fix is to simply 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.

Alternatively, add the following two switches to your linker options:
-static-libgcc
-static-libstdc++

Hi, Sorry to update the old thread, I'm a newbie, how can I add the switches to my linker options?

thanks a lot.

stahta01

Quote from: m.m.m on November 28, 2016, 05:44:51 PM
Hi, Sorry to update the old thread, I'm a newbie, how can I add the switches to my linker options?

thanks a lot.

Project -> Build Options
Select correct target or project in left hand pane
Tab: Linker Settings
Box: Other linker settings
Enter linker options one per line.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

m.m.m

Quote from: stahta01 on November 28, 2016, 08:16:43 PM
Quote from: m.m.m on November 28, 2016, 05:44:51 PM
Hi, Sorry to update the old thread, I'm a newbie, how can I add the switches to my linker options?

thanks a lot.

Project -> Build Options
Select correct target or project in left hand pane
Tab: Linker Settings
Box: Other linker settings
Enter linker options one per line.

Tim S.
Thanks for the solution, I first had two errors, one for libstdc++6.dll and one for libgcc_s_dw2-1.dll, now the error for libstdc++6.dll has solved but the error for libgcc_s_dw2-1.dll still remains.

stahta01

Quote from: m.m.m on November 28, 2016, 09:27:32 PM
Quote from: stahta01 on November 28, 2016, 08:16:43 PM
Quote from: m.m.m on November 28, 2016, 05:44:51 PM
Hi, Sorry to update the old thread, I'm a newbie, how can I add the switches to my linker options?

thanks a lot.

Project -> Build Options
Select correct target or project in left hand pane
Tab: Linker Settings
Box: Other linker settings
Enter linker options one per line.

Tim S.
Thanks for the solution, I first had two errors, one for libstdc++6.dll and one for libgcc_s_dw2-1.dll, now the error for libstdc++6.dll has solved but the error for libgcc_s_dw2-1.dll still remains.

You need to add the right linker option for your compiler; I suggest reading about your compiler to find out the option you need to add; note, I know little to nothing about your compiler it might NOT have any option to fix your problem.

Edit: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

m.m.m

Quote from: stahta01 on November 29, 2016, 03:39:21 AM
You need to add the right linker option for your compiler; I suggest reading about your compiler to find out the option you need to add; note, I know little to nothing about your compiler it might NOT have any option to fix your problem.

Edit: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.

My compiler is MinGW, running on code::blocks 16.01, how can I find the option I need to add?
Thanks a lot

stahta01

Quote from: m.m.m on November 29, 2016, 01:16:12 PM
Quote from: stahta01 on November 29, 2016, 03:39:21 AM
You need to add the right linker option for your compiler; I suggest reading about your compiler to find out the option you need to add; note, I know little to nothing about your compiler it might NOT have any option to fix your problem.

Edit: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.

My compiler is MinGW, running on code::blocks 16.01, how can I find the option I need to add?
Thanks a lot

Step 1: Is figuring out the group that built your compiler!
Is it an TDM's built MinGW GCC?
Is it an TDM's built MinGW64 GCC?
Is it an SJLJ or DW2 built compiler? SJLJ=Set Jump Long Jump DW2 = Drawf2
Yours is likely DW2; but, it is NOT certain.
Step 2: Is getting the Compiler version info. Like 4.9.1 or ??

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

FYI: I am done helping you till you post a build log and/or more info like I have requested.
I hated playing 20 questions as a kid; I consider it a waste of my time and this forum band width now.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

m.m.m

Quote from: stahta01 on November 29, 2016, 03:20:20 PM
Quote from: m.m.m on November 29, 2016, 01:16:12 PM
Quote from: stahta01 on November 29, 2016, 03:39:21 AM
You need to add the right linker option for your compiler; I suggest reading about your compiler to find out the option you need to add; note, I know little to nothing about your compiler it might NOT have any option to fix your problem.

Edit: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.

My compiler is MinGW, running on code::blocks 16.01, how can I find the option I need to add?
Thanks a lot

Step 1: Is figuring out the group that built your compiler!
Is it an TDM's built MinGW GCC?
Is it an TDM's built MinGW64 GCC?
Is it an SJLJ or DW2 built compiler? SJLJ=Set Jump Long Jump DW2 = Drawf2
Yours is likely DW2; but, it is NOT certain.
Step 2: Is getting the Compiler version info. Like 4.9.1 or ??

Tim S.
Sorry for that, I just fixed it by adding C:\mingw\bin to my search directories.
thanks a lot.

ur_naz

Quote from: Alpha on August 23, 2012, 11:19:09 PM
The reason is
Quote from: jens on August 15, 2012, 06:22:53 AM
[...] because it's neither in the search path, nor in the same folder as the exe.
Easiest fix is to simply 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.

Alternatively, add the following two switches to your linker options:
-static-libgcc
-static-libstdc++

This doesn't work for my basic sfml project on cb20.03. i mean using flags. so i have to put libs near my executable file. >:( However it works fine for my basic winapi project. :o