rubenvb - 2014-01-11

Hi Fred,

There is no way to decrease the file size of a statically linked GCC-compiled executable any further, except by things like [url=]UPX[/url], but that is just postprocessing. Just keep in mind a half MB isn't big. It's just relatively larger than with e.g. MSVC. That's because there is C startop code and MinGW-w64 improvements linked into your executable, which MSVC stores in Windows libraries, and thus does not link into the executable.

If you don't want to redistribute the GCC runtime DLLs, you will have to link statically. Note that -static will make you link in all libraries statically, if available. You can use -static-libgcc -static-libstdc++ if you only want those linked statically.

You can diagnose DLL dependencies using Dependency Walker:
You will get detailed information of which DLLs get loaded by an executable and/or DLL.