Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: elSolar on January 02, 2011, 10:48:18 pm

Title: I don't think my code::blocks is using static libraries correctly.
Post by: elSolar on January 02, 2011, 10:48:18 pm
I've been using code::blocks with MinGW to write, compile, and run code on Windows and it's been going fine so far except for one hitch. Lets say I make a program, helloworld.c, compile it, and run it in code::blocks. The program will run perfectly, printing Hello World in the console. If I actually find the file in my hard drive, however, and double click it, I receive the following error:

Quote
The program can't start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem.

So I go and find libgcc_s_dw2-1.dll in my MinGW directory and put in the same directory as helloworld.exe and create a helloworld.exe.local file and it works! So apparently my copy of MinGW is linking that DLL as a dynamic libray, instead of a static one included in the exe. This is quite an annoying issue, but I can't quite figure out how to fix it. My knowledge of GCC, MinGW, and code::blocks is elementary, and my Google-fu hasn't turned up any helpful information. Can anyone help me fix this issue, so that libgcc_s_dw2-1.dll isn't required to be in the same directory as my program?
Title: Re: I don't think my code::blocks is using static libraries correctly.
Post by: oBFusCATed on January 02, 2011, 11:40:44 pm
Hm, have you tried to paste "libgcc_s_dw2-1.dll" in the search box?
Like this: http://lmgtfy.com/?q=libgcc_s_dw2-1.dll ?

Here is the link from the second result: http://www.qtcentre.org/threads/29489-Removing-dependencies-for-mingwm10.dll-and-libgcc_s_dw2-1.dll-static-linking