HDF5 + CMake + MinGW32

Hi, I try to compile HDF5 with MinGW32 and CMake (link
<http://stackoverflow.com/a/25752390/910139>), with enabled THREADSAFE
flag. My system is Windows 7 x64. Compilation goes fine, but I have some
problem on Linking stage. I get *"undefined reference to
InitOnceExecuteOnce"*. I found that this function is part of libkernel32.a (
which I obviously have on my system. I try compilation on other PC, but I
get the same error. What I missed? I appreciate any help.