Author Topic: I don't think my code::blocks is using static libraries correctly.  (Read 4148 times)

elSolar

  • Guest
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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: I don't think my code::blocks is using static libraries correctly.
« Reply #1 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
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]