samedi 27 mai 2017

libgcc_s_dw2-1.dll missing - Avira blocks exe when compiling with -static-libgcc -static-libstdc++

When I write a program in c++ using Code::Blocks (using windows mingw32-gcc-5.3.0 with the -std=c++11 flag), the program works fine when I start it in Code::Blocks using Build and Run, but when I try to run the exe itsself, I get the error

"program can't start because libgcc_s_dw2-1.dll is missing from your computer".

Now, this has been posted quite a lot of times and I have found the following two solutions:

a) add the respective dll to the folder or add its directory to PATH. While this is a solution, I would not really like to do this because it makes the program need an additional file instead of just needing the exe itsself and nothing else.

b) compile with the flags -static-libgccand -static-libstdc++. This is what I would prefer, and the building itsself worked fine. However, when I now try to run the exe, my antivirus (Avira Antivir Free) always immediately blocks the program (signature HEUR/APC), even if it's just a simple Hello World program. Obviously, I don't want that.

So, is there any other solution to this that doesn't immediately trigger antivirus and does not need the dll as a seperate file?

Aucun commentaire:

Enregistrer un commentaire