0

I've found exactly the same topics on stackoverflow, unfortunately none of the solutions presented in similar topics actually worked in my case.

I'm using latest version of CodeLite 7 + MinGW, the problem I got is that everytime I want to compile c++ project I get the following message:

The program can't start because libgcc_s_dw2-1.dll is missing.

Problem known, but frankly nothing works in my case:

1) I did try to swap this file from CodeBlocks \bin directory - didn't work. 2) I did try to update MinGW libraries - didn't work. 3) I did try to add -static in linker options in CodeLite - didn't work 4) Set environmental path to C:\MinGW\bin - didn't work either 5) Download libgcc_s_dw2-1.dll from the Internet, swapped it - didn't work.

Maybe I'm missing something but I don't know how to handle it on my own.

Perhaps I might be doing something wrong with codelite build setting, can you please help me out with this ?

Silvo Dante
  • 1
  • 1
  • 1
  • 1
    3) Suggests to me that either the option wasn't passed to the linker for some reason, or that you only have the dynamic stubs installed. 4) Did you check to see if the dll was actually in that directory? – user657267 Mar 29 '15 at 11:25
  • @user657267, yes it is. Strangely, it was there from the very beggining :( – Silvo Dante Mar 29 '15 at 11:26
  • One quick fix is to copy the dll into the same directory as your program. – user657267 Mar 29 '15 at 11:27
  • yeah, I know but I don't want to do this time and again. I'm looking for some long-term solution :) – Silvo Dante Mar 29 '15 at 11:31
  • Well if the dll is there then clearly something isn't right in how you tried to modify the PATH. As for the -static switch either you don't have the static libs installed or again you aren't configuring the switch correctly. Sorry but I'm not familiar with codeblocks. – user657267 Mar 29 '15 at 11:34
  • Oops my bad, but I have no idea about codelite either, sorry! Either of the things you tried should have worked given a regular mingw installation. – user657267 Mar 29 '15 at 11:41
  • Try to run the program manually, without pressing 'Start' button in your IDE. – HolyBlackCat Mar 29 '15 at 12:20
  • @HolyBlackCat the message alert states exactly the same. – Silvo Dante Mar 29 '15 at 12:32
  • Ok, then, try to compile it manually from the console: 1) `g++ something.cpp -o obj.o` 2) `g++ obj.o -o test.exe -static` and then run it. – HolyBlackCat Mar 29 '15 at 14:06

2 Answers2

1

Go to C:/mingw/bin copy all dll files(it would be easy if u sort by type) and paste it in the codelite folder and you are done.

Adarsh
  • 59
  • 6
1

add the following in the project setting linker option:

-static-libgcc -static-libstdc++
gofr1
  • 15,741
  • 11
  • 42
  • 52
abv
  • 11
  • 1