1

I just went through writing a fairly lengthly application in c++ using mingw and I went to give it to a few friends to try it out. When they went to execute the .exe file it came up with an error that 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

This error occurs with the debug version. Compiling with the release version comes up with the same error except "libgcc_s_dw2" is replaced with "libstdc++-6".

I was able to fix this issue by including the .dll's with the .exe but I would rather it be standalone for when I decide to release it to more of a general audience.

I have found this question asked a lot but all of them say to add -static-libstdc++ to the linker options.

I am using CodeBlocks and went to build options and put it in the same location I linked MinGW with. This didn't work, so I tried the other box next to it for additional options but that didn't work either.

I know it's probably a simple thing that I'm missing but I can't think of anywhere to put it.

I appreciate any help and thanks in advance.

1
  • I had this problem. Then I switched to Roger- I mean this... Seriously, though, it was the best programming choice I ever made. Commented Jun 22, 2012 at 23:01

1 Answer 1

1

I added the options -static-libgcc and -static-libstdc++ to the Linker settings as shown here (separated by a space) and it worked for me.

Make sure to rebuild your executable from the Build menu (or with Ctrl-F11), CodeBlocks won't rebuild it if you just try to build after changing the settings.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.