QT mingwGM compile source code ERROR

I want use openCV with Qt in Windows, so I downloaded the sourse code of openCV 4.5.2. After I using CMake config compiler to mingwGM and generated the makefile, I tried to compile the code. I tried several time, but I can’t resolve this problem:

CMakeFiles\opencv_highgui.dir/objects.a(window.cpp.obj):window.cpp:(.text$cvSetWindowProperty+0x27): undefined reference to `cvSetPropVsync_W32(char const*, bool)'
CMakeFiles\opencv_highgui.dir/objects.a(window.cpp.obj):window.cpp:(.text$cvGetWindowProperty+0x36): undefined reference to `cvGetPropVsync_W32(char const*)'
CMakeFiles\opencv_highgui.dir/objects.a(window.cpp.obj):window.cpp:(.text$_ZN2cv17setWindowPropertyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEid+0x5b): undefined reference to `cvSetPropVsync_W32(char const*, bool)'
CMakeFiles\opencv_highgui.dir/objects.a(window.cpp.obj):window.cpp:(.text$_ZN2cv17getWindowPropertyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi+0x91): undefined reference to `cvGetPropVsync_W32(char const*)'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:222: bin/libopencv_highgui452.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2684: modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2

My mingwGM version: 8.1.0
My Qt version: 5.15.1
My CMake version: 3.21.0

always search for the error