Actually, I did not yet cure the problem.
My link was not static, so it needs msys2 to run.
When I change to static linking, I get the same curl errors.
For example:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../lib\libcurl.a(libcurl_la-schannel.o):(.text+0x131e): undefined reference to `__imp_CertFindCertificateInStore'
It looks to me like curl cannot find OpenSSL
I have it installed.
But at least I have a way to run it myself.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.