0


I've been doing a simple c++ program with use of curlpp library. I can build and compile everything just right and I can run it if having MinGW in my PATH. When I delete it and copy all curlpp dlls in the directory, it says (of course):

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 believe that the problem is that std libraries are not linked statically, but I tried all possibilities and it seems as they are not linked. I type:

g++ -o myApp.exe main.cpp -std=gnu++11 -L(curl,curlpp,opensll) -I(all includes) -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++  -Wl,-Bdynamic -lcurlpp -lcurl -Wl,--as-needed

with no errors, then I run it and I get error from above. Of course, if I have MinGW in my PATH, then everything works.

I tried to change the order of options in the command without any luck. Putting -static-libgcc -static-libstdc++ as advised elsewhere is not working.
Thanks in advance
Regards

C Chorche
  • 39
  • 6
  • Possible duplicate of [The program can't start because libgcc\_s\_dw2-1.dll is missing](https://stackoverflow.com/questions/4702732/the-program-cant-start-because-libgcc-s-dw2-1-dll-is-missing) – user7860670 Jan 16 '18 at 09:10
  • 1
    @VTT: Been there and as you can see from my code, -static-libgcc and -static-libstdc++ didn't work. – C Chorche Jan 16 '18 at 09:16
  • You also need to make sure that all the dynamic libraries you are trying to use won't link them dynamically. You can use something like dependency walker to inspect where `libgcc_s_dw2-1.dll` demand is coming from. – user7860670 Jan 16 '18 at 09:30

0 Answers0