It does not work either. After opening project with target linker section as such:
<Linker>
<Add option="-s" />
<Add option="-static" />
<Add library="c:/curl-7.88.1/lib/.libs/libcurl.a" />
<Add library="libgdiplus.a" />
<Add library="libcomctl32.a" />
<Add library="libgdi32.a" />
<Add library="libbcrypt.a" />
<Add library="libcrypto.a" />
<Add library="libssl.a" />
<Add library="libzstd.a" />
<Add library="libz.a" />
<Add library="libwldap32.a" />
<Add library="libcrypt32.a" />
<Add library="libws2_32.a" />
<Add library="libcrypto.a" />
<Add library="libssl.a" />
<Add directory="C:/msys64/mingw32/lib" />
</Linker>
Result is:
It works until restart.
But as I wrote this post I thought about solution to mklink these 2 libraries I need duplicated to different location and add them full path second time and it works, does not remove as duplicate.
The linker section look now like this:
<Linker>
<Add option="-s" />
<Add option="-static" />
<Add library="c:/curl-7.88.1/lib/.libs/libcurl.a" />
<Add library="libgdiplus.a" />
<Add library="libmsimg32.a" />
<Add library="libbcrypt.a" />
<Add library="libcrypto.a" />
<Add library="libssl.a" />
<Add library="C:/libdup/libcrypto.a" />
<Add library="C:/libdup/libssl.a" />
<Add library="libzstd.a" />
<Add library="libz.a" />
<Add library="libwldap32.a" />
<Add library="libcrypt32.a" />
<Add library="libws2_32.a" />
<Add directory="C:/msys64/mingw32/lib" />
</Linker>
BTW when adding library path to linker search path and entering them by filename without full path they become linker options instead in build log, only libraries added by full path appear as files in build log, so maybe adding them all as full path would work, or maybe it would still be seen as duplicate and would be removed.
-s -static -lgdi32 -luser32 -lkernel32 -lcomctl32 c:\curl-7.88.1\lib\.libs\libcurl.a -lgdiplus -lmsimg32 -lbcrypt -lcrypto -lssl C:\libdup\libcrypto.a C:\libdup\libssl.a -lzstd -lz -lwldap32 -lcrypt32 -lws2_32 -mwindows
Thanks for the idea for the workaround :]