OpenCV 4.2 with geforce 3050Ti

Ignore my previous comment, I think you need to add these lines

because the naming of the headers changed see PR to update to CUDA 11.0 below

for details.

As @crackwitz alluded to you are using an old version of OpenCV which pre-dates CUDA 11.0 so many many things could fail even if you manage to build it.