Code::Blocks Forums
User forums => Using Code::Blocks => Topic started 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 ]
-
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.
-
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!
-
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!
-
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. :)
-
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++
-
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.
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
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.
-
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
-
-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?