.lib and .a do not match. Changing the file extension lies with the linker, so it does not work.
32- , , " ". MinGW 32- .lib . , .
64- , MinGW-w64 - (, 64- TDM-GCC), . FAQ MinGW-w64:
gendef mylib.dll
dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libmylib.a --input-def mylib.def