Error building and application that uses OpenCV with CUDA

I’m getting a link error
libopencv_cudastereo.so: undefined reference to `cv::cuda::StreamAccessor::getStream(cv::cuda::Stream const&)’

I see a StreamAccessor::getStream related symbol in libopencv_core.so, so I added libopencv_core.so to the linked libraries in cmake, but I’m still getting the error.

find /workspace/sdk-myapp/opencv-4.2.0/opencv/GCC_9_4_0/local_install/lib -name "libopencv_core.so" -exec nm --print-file-name --defined-only {} \; | grep getStream | grep StreamAccesso
/workspace/sdk-myapp/opencv-4.2.0/opencv/GCC_9_4_0/local_install/lib/libopencv_core.so:00000000001bb3e0 T _ZN2cv4cuda14StreamAccessor9getStreamERKNS0_6StreamE

Do you get the same error with the latest version of OpenCV? Can you post your CMake command line, configuration output, and build command?