Link error:unresolved external symbol "struct cv::Ptr<class cv::cuda::TemplateMatching>

Trying to test the following below and getting the errors

Error LNK2001 unresolved external symbol
"struct cv::Ptr …

Compilation do pass.
The question boils to:How do one know which library to use
or where tom find the missing item?
(Found nothing on the network)


#include <opencv2/opencv.hpp>
#include <cudaimgproc.hpp>
#include <cuda_runtime.h>
#include <cudaimgproc.hpp>

int c1test()
cv::cuda::GpuMat image_h(1080, 1920, CV_8UC1);
cv::cuda::GpuMat templ_h(64, 64, CV_8UC1);
cv::cuda::GpuMat result(1080 - 64 + 1, 1920 - 64 + 1, CV_32FC1);

cv::Ptr<cv::cuda::TemplateMatching> alg;
alg = cv::cuda::createTemplateMatching(templ_h.type(), CV_TM_CCOEFF_NORMED);
alg->match(image_h, templ_h, result);



Open CV 4.2
Cuda 10.2
Visual Studio 2019 professional C++
Windows 10