title: Enabling cuda support for opencv
body: <p>My goal is to enable the cuda support for opencv.I followed the guide from <a href="https://jamesbowley.co.uk/build-opencv-4-0-0-with-cuda-10-0-and-intel-mkl-tbb-in-windows/" rel="nofollow noreferrer">https://jamesbowley.co.uk/build-opencv-4-0-0-with-cuda-10-0-and-intel-mkl-tbb-in-windows/</a> or
  <a href="https://www.youtube.com/watch?v=TT3_dlPL4vo" rel="nofollow noreferrer">https://www.youtube.com/watch?v=TT3_dlPL4vo</a>
  However, after complilation times, there's some error with it and i can't make it succesfully.Did anyone encountered this problem before and can share the solution of it?</p>
  
  <p><a href="https://i.stack.imgur.com/Lqhz1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lqhz1.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>"D:\opencvcuda\opencv-master\build\INSTALL.vcxproj" (default target) (1) ->
    (PostBuildEvent target) ->
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(
    149,5): error MSB3073: The command "setlocal [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: D:\CMake\bin\cmake.exe -DBUILD_TYPE=Release -P cmake_install.cmake [D:\opencvcuda\opencv-master\bu
    ild\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: :cmEnd [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone [D:\opencvcuda\opencv-master\build\INSTA
    LL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: :cmErrorLevel [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: exit /b %1 [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: :cmDone [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(14
    9,5): error MSB3073: :VCEnd" exited with code 1. [D:\opencvcuda\opencv-master\build\INSTALL.vcxproj]</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/TUfPn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TUfPn.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>CMake Error at modules/python3/cmake_install.cmake:44 (file):
    file cannot create directory: C:/Program Files (x86)/Microsoft Visual
    Studio/Shared/Python37_64/Lib/site-packages/cv2.  Maybe need administrative
    privileges.
    Call Stack (most recent call first):modules/cmake_install.cmake:189 (include)cmake_install.cmake:125 (include)
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: The command "setlocal
    D:\Program Files (x86)\Microsoft Visual
    Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: D:\CMake\bin\cmake.exe -DBUILD_TYPE=Debug -P cmake_install.cmake
    D:\Program Files (x86)\Microsoft Visual
    Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmEnd
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmErrorLevel
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: exit /b %1
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmDone
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :VCEnd" exited with code 1.
    Done building project "INSTALL.vcxproj" -- FAILED.
    ========== Build: 195 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========</p>
  </blockquote>