Unable to build OpenCV with the contrib modules

I am using CMake gui, opencv_contrib 4.x and tried both opencv 4.7 and 4.8.
Everytime i build ALL_BUILD in VS2019 (x64). I get a ton of errors mostly from cv::hal_baseline and most in the form of overloading or different number of parameters.

Severity Code Description Project File Line Suppression State
Error C2780 ‘cv::hal_baseline::v_uint64x2 cv::hal_baseline::v_shr(const cv::hal_baseline::v_uint64x2 &)’: expects 1 arguments - 2 provided opencv_xphoto C:\Installations\CudaOpenCV\src\opencv_contrib-4.x\modules\xphoto\src\grayworld_white_balance.cpp 328

I also am trying to build all of them even though i mostly need only cuda related ones like cudaarithm for example.

What could I be possible doing wrong. I am not checking world either.

disable that module then. it’s in the cmake gui.

maybe the module is currently broken.

make sure to check out tagged versions for both contrib and main repos. they also need to match. master branch may not always be buildable.