Windows is very not recommended, please take off the pits as soon as possible
Related Downloads
Steps
Installation WinGW-W64
, CMake
, OpenCV
. Finally my directory is: C:\Tools\CMake
, C:\Tools\MinGW-W64
, C:\Tools\OpenCV
.
It is then C:\Tools\MinGW-W64\mingw64\bin
added to the system variable.
Run C:\Tools\CMake\bin\cmake-gui.exe
.
Click Browse Source
Select C:/Tools/OpenCV/sources
.
Click Browse Build
Select C:/Tools/OpenCV/mingw-build
. ( mingw-build
created by yourself).
Click below Configure
, select MinGW Makefiles
, this operation will download a few files in the middle, take a long time.
After the progress bar has gone, the middle area will appear a lot of red, click again Configure
, red all disappear.
The last point Generate
can be.
Open with command line C:\Tools\OpenCV\mingw-build
, run
mingw32-make.exe
The process time is longer, wait patiently 100%
.
CMakeLists.txt configuration file for OpenCV project
cmake_minimum_required(VERSION 3.9)project(opencv)set(CMAKE_CXX_STANDARD 11)add_executable(opencv main.cpp)set(OpenCV_DIR "C:/Tools/OpenCV/mingw-build/install")set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")find_package(OpenCV REQUIRED)include_directories(${OpenCV_INCLUDE_DIRS})target_link_libraries(opencv ${OpenCV_LIBS})
Common errors
invalid register for .seh_savexmm
:
After the first point is finished Configure
, enter in the above, Search
cpu
and then a CPU_DISPATCH
configuration item appears, setting the Value
value to null.
Windows + wingw-w64 + CMake build OpenCV