Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: yuk.f on August 15, 2012, 05:05:46 am

Title: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: yuk.f on August 15, 2012, 05:05:46 am
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 ]
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: Jenna 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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: yuk.f on August 15, 2012, 06:44:48 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!
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: Jenna on August 15, 2012, 08:19:07 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!
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: Saerdus on August 23, 2012, 09:31:58 pm
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.  :)

Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: Alpha on August 23, 2012, 11:19:09 pm
The reason is
[...] 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++
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: m.m.m on November 28, 2016, 05:44:51 pm
The reason is
[...] 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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: stahta01 on November 28, 2016, 08:16:43 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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: m.m.m on November 28, 2016, 09:27:32 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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: stahta01 on November 29, 2016, 03:39:21 am
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 (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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: m.m.m on November 29, 2016, 01:16:12 pm
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 (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
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: stahta01 on November 29, 2016, 03:20:20 pm
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 (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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: stahta01 on November 29, 2016, 03:40:36 pm
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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: m.m.m on November 29, 2016, 04:14:38 pm
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 (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.
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: ur_naz on December 26, 2024, 01:06:53 pm
The reason is
[...] 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
Title: Re: program can't start because libgcc_s_dw2-1.dll is missing from your computer
Post by: nenin on December 27, 2024, 08:51:12 am

-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
You can try just  "-static".   Was sfml linked as static lib or as dll?