On Wednesday, 16 November 2022 at 16:36:05 UTC Albrecht Schlosser wrote:
3. CMAKE_EXE_LINKER_FLAGS="-static-libgcc
-static-libstdc++": make sure you don't need these DLL's
My mingw64 builds DO NOT need these set.
Does "mingw64" mean MSYS2/mingw64? If yes I'd be interested to know
how to setup this so we can document it for other users.
My mingw32 builds DO need these set.
I assume this means classic "MinGW" where I made this experience as
well.
So... up until around the gcc-3 to gcc-4 transition in mingw32 (which must be getting on for 20 years ago now?) I never needed "-static-libgcc -static-libstdc++" at all.
With gcc-4 and later and mingw32, I do need to add "-static-libgcc -static-libstdc++".
But... at some point, I started doing more 64-bit Windows builds, initially using the TDM-gcc-5.1 compiler (which I often still use, FWIW, even though it is getting pretty old now!) and with that I have never needed to add the "-static-libgcc -static-libstdc++" options.
Later again, I started using Msys2 and their mingw64-gcc options. With that I find some set-ups need the "-static-libgcc -static-libstdc++" flags, others do not. I have *no clue* what I am doing different when setting up these installs... I assume it is some difference in my config but... This is, frankly, because I never pay any attention when setting these things up, and can never remember what packages are needed anyway, so they all end up with some weirdly different set as I randomly add packages until it works...