diff --git a/modules/cudalegacy/src/bm_fast.cpp b/modules/cudalegacy/src/bm_fast.cpp index c418e4bc93..ecb87908fc 100644 --- a/modules/cudalegacy/src/bm_fast.cpp +++ b/modules/cudalegacy/src/bm_fast.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::cuda; -#if !defined HAVE_CUDA || defined(CUDA_DISABLER) +#if !defined HAVE_CUDA || !defined(HAVE_OPENCV_CUDAARITHM) || defined(CUDA_DISABLER) void cv::cuda::FastOpticalFlowBM::operator ()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, int, int, Stream&) { throw_no_cuda(); } diff --git a/modules/cudalegacy/src/needle_map.cpp b/modules/cudalegacy/src/needle_map.cpp index 51cb9dffc0..185bfc1e82 100644 --- a/modules/cudalegacy/src/needle_map.cpp +++ b/modules/cudalegacy/src/needle_map.cpp @@ -45,7 +45,7 @@ using namespace cv; using namespace cv::cuda; -#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) +#if !defined (HAVE_CUDA) || !defined(HAVE_OPENCV_CUDAIMGPROC) || defined (CUDA_DISABLER) void cv::cuda::createOpticalFlowNeedleMap(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&) { throw_no_cuda(); }