Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in i18n_book_navigation_set_breadcrumb() (line 212 of /home/sasaoj5/public_html/

Build OpenCV on Windows

Open "x64 Native Tools Command Prompt for VS 2017"  from "Visual Studio 2017" Folder in Start Menu of Windows 10.

Create 'windows-opencv-setup.bat' file with following contents, then run it.

@echo off
setlocal enableextensions
set src_dir=%HOME%\source
if %VisualStudioVersion% EQU 14.0 (
   set GENERATOR="Visual Studio 14 2015 Win64"
   set build_dir=%src_dir%\build-vc14-x86_64
if %VisualStudioVersion% EQU 15.0 (
   set GENERATOR="Visual Studio 15 2017 Win64"
   set build_dir=%src_dir%\build-vc15-x86_64
set CWD=%cd%
set opencv_dir=%src_dir%\opencv
set opencv_contrib_dir=%src_dir%\opencv_contrib
set opencv_extra_dir=%src_dir%\opencv_extra
set opencv_build_dir=%build_dir%\opencv.release
set BUILD_CONFIG="Release"
if not exist %opencv_dir% (
   cd %src_dir%
   git clone
if not exist %opencv_contrib_dir% (
   cd %src_dir%
   git clone
if not exist %opencv_extra_dir% (
   cd %src_dir%
   git clone
if not exist %opencv_build_dir% (
   mkdir %opencv_build_dir%
cd %opencv_build_dir%
echo opencv build directory: %cd%
cmake -DCMAKE_EXTRA_MODULES_PATH=%opencv_contrib_dir%\modules ^
  -DENABLE_CXX11=ON     ^
  -DBUILD_PERF_TESTS=OFF            ^
  -DWITH_XINE=ON                    ^
  -DBUILD_TESTS=OFF                 ^
  -DCMAKE_SKIP_RPATH=ON             ^
  -DCUDA_FAST_MATH=%CUDA%           ^
  -DWITH_CUBLAS=%CUDA%              ^
  -DCUDA_NVCC_FLAGS="--expt-relaxed-constexpr" ^
  -G %GENERATOR% %opencv_dir%
:devenv OpenCV.sln
:msbuild /m:%nproc% /p:Configuration=Debug INSTALL.vcxproj
msbuild OpenCV.sln /m:%nproc% /p:Configuration=Release /t:build
cd %CWD%


User login