<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.5.2</li>
<li>Operating System / Platform =&gt; Windows 10 x64</li>
<li>Compiler =&gt; Visual Studio 2019 (19.29.30038.1 for x64)</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I was following <a href="https://haroonshakeel.medium.com/build-opencv-4-4-0-with-cuda-gpu-support-on-windows-10-without-tears-aa85d470bcd0" rel="nofollow">https://haroonshakeel.medium.com/build-opencv-4-4-0-with-cuda-gpu-support-on-windows-10-without-tears-aa85d470bcd0</a> to compile OpenCV with CUDA support but for 4.5.2, but it does not compile.</p>
<p dir="auto">Partial build log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(19): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(19): error : explicit type is missing (&quot;int&quot; assumed)
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(20): error : expected a &quot;{&quot;
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(22): error : identifier &quot;data&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(23): warning : missing return statement at end of non-void function &quot;GpuData&quot;
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(25): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(27): error : identifier &quot;data&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(33): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(33): error : identifier &quot;SizeArray&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(36): error : identifier &quot;SizeArray&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(39): error : more than one conversion function from &quot;lambda [](unsigned int)-&gt;__nv_bool&quot; to &quot;&lt;error-type&gt;&quot; applies:
24&gt;            function &quot;lambda [](unsigned int)-&gt;__nv_bool::operator __nv_bool (*)(unsigned int)() const&quot;
24&gt;            function &quot;lambda [](unsigned int)-&gt;__nv_bool::operator __nv_bool (*)(unsigned int)() const&quot;
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier &quot;size&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier &quot;type&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier &quot;empty&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier &quot;external&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier &quot;isContinuous&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier &quot;isSubmatrix&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(50): error : identifier &quot;release&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(52): error : identifier &quot;setFields&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(54): error : identifier &quot;data_&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(54): error : identifier &quot;GpuData&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(54): error : identifier &quot;totalMemSize&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(55): error : identifier &quot;data&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(56): error : identifier &quot;offset&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(62): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(64): error : identifier &quot;data&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(65): error : identifier &quot;data_&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(67): error : identifier &quot;flags&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(67): error : identifier &quot;dims&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(67): error : identifier &quot;offset&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(68): error : identifier &quot;size&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(69): error : identifier &quot;step&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(75): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(75): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(105): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(105): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(105): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(109): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(109): error : identifier &quot;size&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(109): error : identifier &quot;type&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(111): error : identifier &quot;isContinuous&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(113): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(119): error : identifier &quot;dims&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(121): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(121): error : identifier &quot;step&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(131): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(136): error : identifier &quot;step&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(142): error : &quot;this&quot; may only be used inside a nonstatic member function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(151): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(151): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(151): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(155): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(155): error : identifier &quot;size&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(155): error : identifier &quot;type&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(159): error : identifier &quot;isContinuous&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(161): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(167): error : identifier &quot;dims&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(169): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(169): error : identifier &quot;step&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(179): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(184): error : identifier &quot;step&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(190): error : &quot;this&quot; may only be used inside a nonstatic member function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(200): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(209): error : identifier &quot;SizeArray&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(212): error : identifier &quot;create&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(214): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(214): error : identifier &quot;totalMemSize&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(217): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(226): error : identifier &quot;SizeArray&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(229): error : identifier &quot;create&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(232): error : identifier &quot;getDevicePtr&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(232): error : identifier &quot;totalMemSize&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(238): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(238): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(242): error : identifier &quot;dims&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(242): error : identifier &quot;size&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(242): error : identifier &quot;type&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(245): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(245): error : &quot;this&quot; may only be used inside a nonstatic member function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(253): error : name followed by &quot;::&quot; must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(253): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(257): error : identifier &quot;dims&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(257): error : identifier &quot;size&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(257): error : identifier &quot;type&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(260): error : identifier &quot;GpuMatND&quot; is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(260): error : &quot;this&quot; may only be used inside a nonstatic member function
24&gt;
24&gt;85 errors detected in the compilation of &quot;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu&quot;.
24&gt;gpu_mat_nd.cu
24&gt;CMake Error at cuda_compile_1_generated_gpu_mat_nd.cu.obj.Release.cmake:280 (message):
24&gt;  Error generating file
24&gt;  G:/opencv-master/opencv/build/modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/cuda_compile_1_generated_gpu_mat_nd.cu.obj
24&gt;"><pre class="notranslate"><code class="notranslate">24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(19): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(19): error : explicit type is missing ("int" assumed)
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(20): error : expected a "{"
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(22): error : identifier "data" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(23): warning : missing return statement at end of non-void function "GpuData"
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(25): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(27): error : identifier "data" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(33): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(33): error : identifier "SizeArray" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(36): error : identifier "SizeArray" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(39): error : more than one conversion function from "lambda [](unsigned int)-&gt;__nv_bool" to "&lt;error-type&gt;" applies:
24&gt;            function "lambda [](unsigned int)-&gt;__nv_bool::operator __nv_bool (*)(unsigned int)() const"
24&gt;            function "lambda [](unsigned int)-&gt;__nv_bool::operator __nv_bool (*)(unsigned int)() const"
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier "size" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier "type" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier "empty" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier "external" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier "isContinuous" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(47): error : identifier "isSubmatrix" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(50): error : identifier "release" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(52): error : identifier "setFields" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(54): error : identifier "data_" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(54): error : identifier "GpuData" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(54): error : identifier "totalMemSize" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(55): error : identifier "data" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(56): error : identifier "offset" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(62): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(64): error : identifier "data" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(65): error : identifier "data_" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(67): error : identifier "flags" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(67): error : identifier "dims" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(67): error : identifier "offset" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(68): error : identifier "size" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(69): error : identifier "step" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(75): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(75): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(105): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(105): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(105): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(109): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(109): error : identifier "size" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(109): error : identifier "type" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(111): error : identifier "isContinuous" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(113): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(119): error : identifier "dims" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(121): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(121): error : identifier "step" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(131): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(136): error : identifier "step" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(142): error : "this" may only be used inside a nonstatic member function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(151): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(151): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(151): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(155): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(155): error : identifier "size" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(155): error : identifier "type" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(159): error : identifier "isContinuous" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(161): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(167): error : identifier "dims" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(169): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(169): error : identifier "step" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(179): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(184): error : identifier "step" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(190): error : "this" may only be used inside a nonstatic member function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(200): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(209): error : identifier "SizeArray" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(212): error : identifier "create" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(214): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(214): error : identifier "totalMemSize" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(217): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(226): error : identifier "SizeArray" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(229): error : identifier "create" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(232): error : identifier "getDevicePtr" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(232): error : identifier "totalMemSize" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(238): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(238): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(242): error : identifier "dims" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(242): error : identifier "size" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(242): error : identifier "type" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(245): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(245): error : "this" may only be used inside a nonstatic member function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(253): error : name followed by "::" must be a class or namespace name
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(253): error : a type qualifier is not allowed on a nonmember function
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(257): error : identifier "dims" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(257): error : identifier "size" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(257): error : identifier "type" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(260): error : identifier "GpuMatND" is undefined
24&gt;
24&gt;G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu(260): error : "this" may only be used inside a nonstatic member function
24&gt;
24&gt;85 errors detected in the compilation of "G:/opencv-master/opencv/modules/core/src/cuda/gpu_mat_nd.cu".
24&gt;gpu_mat_nd.cu
24&gt;CMake Error at cuda_compile_1_generated_gpu_mat_nd.cu.obj.Release.cmake:280 (message):
24&gt;  Error generating file
24&gt;  G:/opencv-master/opencv/build/modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/cuda_compile_1_generated_gpu_mat_nd.cu.obj
24&gt;
</code></pre></div>
<p dir="auto"><code class="notranslate">nvcc --version</code> output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:54:10_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.relgpu_drvr455TC455_06.29190527_0"><pre class="notranslate"><code class="notranslate">Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:54:10_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.relgpu_drvr455TC455_06.29190527_0
</code></pre></div>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.4.0</li>
<li>Operating System / Platform =&gt; Windows 64 Bit</li>
<li>Compiler =&gt; Visual Studio 2019</li>
<li>CUDA =&gt; 11.1</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I was following <a href="https://haroonshakeel.medium.com/build-opencv-4-4-0-with-cuda-gpu-support-on-windows-10-without-tears-aa85d470bcd0" rel="nofollow">https://haroonshakeel.medium.com/build-opencv-4-4-0-with-cuda-gpu-support-on-windows-10-without-tears-aa85d470bcd0</a> to compile OpenCV with CUDA support, but it does not compile.</p>
<p dir="auto">Partial build log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(93): error : NPPTypeTraits is not a template
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(95): error : expected a type specifier
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(95): error : identifier &quot;NppiSize&quot; is undefined
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(95): error : function returning function is not allowed
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(98): error : class &quot;&lt;unnamed&gt;::NppBitwiseCFunc&lt;0, 3&gt;&quot; has no member &quot;func_t&quot;
22&gt;          detected during processing of template argument list for &quot;&lt;unnamed&gt;::NppBitwiseC&quot; based on template arguments &lt;0, 3&gt;
22&gt;(135): here"><pre class="notranslate"><code class="notranslate">22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(93): error : NPPTypeTraits is not a template
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(95): error : expected a type specifier
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(95): error : identifier "NppiSize" is undefined
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(95): error : function returning function is not allowed
22&gt;
22&gt;G:/opencv_contrib-4.4.0/modules/cudaarithm/src/cuda/bitwise_scalar.cu(98): error : class "&lt;unnamed&gt;::NppBitwiseCFunc&lt;0, 3&gt;" has no member "func_t"
22&gt;          detected during processing of template argument list for "&lt;unnamed&gt;::NppBitwiseC" based on template arguments &lt;0, 3&gt;
22&gt;(135): here
</code></pre></div>
<p dir="auto"><code class="notranslate">nvcc --version</code> output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:54:10_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.relgpu_drvr455TC455_06.29190527_0```"><pre lang="nvcc:" class="notranslate"><code class="notranslate">Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:54:10_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.relgpu_drvr455TC455_06.29190527_0```
</code></pre></div>