Windows + wingw-w64 + CMake build OpenCV

Source: Internet
Author: User

Windows is very not recommended, please take off the pits as soon as possible

Related Downloads
    • WINGW-W64 Project Address

    • CMake website Address

    • OpenCV website Address

Steps
    1. Installation WinGW-W64 , CMake , OpenCV . Finally my directory is: C:\Tools\CMake , C:\Tools\MinGW-W64 , C:\Tools\OpenCV .

    2. It is then C:\Tools\MinGW-W64\mingw64\bin added to the system variable.

    3. Run C:\Tools\CMake\bin\cmake-gui.exe .

    4. Click Browse Source Select C:/Tools/OpenCV/sources .

    5. Click Browse Build Select C:/Tools/OpenCV/mingw-build . ( mingw-build created by yourself).

    6. Click below Configure , select MinGW Makefiles , this operation will download a few files in the middle, take a long time.

    7. After the progress bar has gone, the middle area will appear a lot of red, click again Configure , red all disappear.

    8. The last point Generate can be.

    9. 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
    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.