Under msys2, running the following command copies all dependent DLLs to the current directory:
$ ldd mygtkapp.exe | grep '\/mingw.*\.dll' -o | xargs -I{} cp "{}" .Where mygtkapp.exe is the executable in question (e.g. gtk3-demo, etc). This
ensures that the necessary DLLs are bundled in the application folder so the end
user does not need their own installation of msys2.
All credit to: https://stackoverflow.com/a/50130668