I am using the latest opencv4.20 + visual studio2019 + CUDA10.2, following is the error message:
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------ 2>------ Build started: Project: opencv_rgbd, Configuration: Debug x64 ------ 2>dynafu.cpp 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(242,28): warning C4244: '=': conversion from 'double' to '_Tp', possible loss of data 2> with 2> [ 2> _Tp=float 2> ] 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(206): message : while compiling class template member function 'void cv::dynafu::DynaFuImpl<cv::mat>::drawScene(cv::OutputArray,cv::OutputArray)' 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(524): message : see reference to function template instantiation 'void cv::dynafu::DynaFuImpl<cv::mat>::drawScene(cv::OutputArray,cv::OutputArray)' being compiled 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(273): message : while compiling class template member function 'cv::dynafu::DynaFuImpl<cv::mat>::~DynaFuImpl(void)' 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(289): message : see reference to class template instantiation 'cv::dynafu::DynaFuImpl<cv::mat>' being compiled 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(181,5): error C3861: 'glGenRenderbuffersEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(169): message : while compiling class template member function 'cv::dynafu::DynaFuImpl<cv::mat>::DynaFuImpl(const cv::dynafu::Params &)' 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory(204): message : see reference to function template instantiation 'cv::dynafu::DynaFuImpl<cv::mat>::DynaFuImpl(const cv::dynafu::Params &)' being compiled 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\memory(1491): message : see reference to function template instantiation 'void std::_Construct_in_place<_Ty,const cv::dynafu::Params&>(_Ty &,const cv::dynafu::Params &) noexcept(false)' being compiled 2> with 2> [ 2> _Ty=cv::dynafu::DynaFuImpl<cv::mat> 2> ] 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\memory(1591): message : see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<const cv::dynafu::params&>(const="" cv::dynafu::params="" &)'="" being="" compiled="" 2=""> with 2> [ 2> _Ty=cv::dynafu::DynaFuImpl<cv::mat> 2> ] 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\memory(1591): message : see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<const cv::dynafu::params&>(const="" cv::dynafu::params="" &)'="" being="" compiled="" 2=""> with 2> [ 2> _Ty=cv::dynafu::DynaFuImpl<cv::mat> 2> ] 2>E:\OpenCV4.2\SourceCode\opencv-4.2.0\modules\core\include\opencv2\core\cvstd_wrapper.hpp(146): message : see reference to function template instantiation 'std::shared_ptr<t> std::make_shared<_Tp,const _Ty&>(const _Ty &)' being compiled 2> with 2> [ 2> T=cv::dynafu::DynaFuImpl<cv::mat>, 2> _Tp=cv::dynafu::DynaFuImpl<cv::mat>, 2> _Ty=cv::dynafu::Params 2> ] 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(544): message : see reference to function template instantiation 'cv::Ptr<cv::dynafu::dynafuimpl<cv::mat>> cv::makePtr<cv::dynafu::dynafuimpl<cv::mat>,_Ty>(const _Ty &)' being compiled 2> with 2> [ 2> _Ty=cv::dynafu::Params 2> ] 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(182,27): error C2065: 'GL_RENDERBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(182,5): error C3861: 'glBindRenderbufferEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(183,30): error C2065: 'GL_RENDERBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(183,5): error C3861: 'glRenderbufferStorageEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(186,5): error C3861: 'glGenFramebuffersEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(187,26): error C2065: 'GL_FRAMEBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(187,5): error C3861: 'glBindFramebufferEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(189,34): error C2065: 'GL_FRAMEBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(189,54): error C2065: 'GL_DEPTH_ATTACHMENT_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(189,79): error C2065: 'GL_RENDERBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(189,5): error C3861: 'glFramebufferRenderbufferEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(193,5): error C3861: 'glGenRenderbuffersEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(194,27): error C2065: 'GL_RENDERBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(194,5): error C3861: 'glBindRenderbufferEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(195,30): error C2065: 'GL_RENDERBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(195,5): error C3861: 'glRenderbufferStorageEXT': identifier not found 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(197,34): error C2065: 'GL_FRAMEBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(197,54): error C2065: 'GL_COLOR_ATTACHMENT0_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(197,80): error C2065: 'GL_RENDERBUFFER_EXT': undeclared identifier 2>E:\OpenCV4.2\SourceCode\opencv_contrib-4.2.0\modules\rgbd\src\dynafu.cpp(197,5): error C3861: 'glFramebufferRenderbufferEXT': identifier not found 2>Done building project "opencv_rgbd.vcxproj" -- FAILED. ========== Build: 1 succeeded, 1 failed, 20 up-to-date, 0 skipped ==========