How to create OpenCV 3.2.0 using MinGW on Windows

This post contains all the problems that I (and other users) have when creating a library from sources. Since there is no tutorial, I decided to create such a frequently asked position to combine all the solutions. Hope this helps!

Configuration:
OpenCV 3.2.0
MinGW-w64 x86_64-6.1.0-win32-seh-rt_v5-rev0

You can add additional information to the answers, as it is most convenient in one place.

+2
source share
1 answer
  • Download and unzip OpenCV to a folder of your choice.
  • opencv\sources CMakeLists.txt . CMake. CLION CMakeLists.txt.

    • 1: sprintf () .
      add_definitions(-DSTRSAFE_NO_DEPRECATE) CMakeLists.txt. STRSAFE_NO_DEPRECATE .
    • 2: " " as.exe.
      CMakeLists.txt ():

      set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wa,-mbig-obj")
      set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-Wa,-mbig-obj")
      
    • 3: " 8- ".
      , hardcoding 0x88 mask_lo = _MM_SHUFFLE(2, 0, 2, 0) ( 10 00 10 00) 0xDD mask_hi.
      , .
    • 4: ++ 11 thread MinGW.
      , : #include <mingw.*.h> <mutex>, <thread>, <condition_variable> #endif // C++11. ()
  • ! 30-40 .
  • . , Makefile.
    cmd, cd [path to compiler]\mingw32-make.exe install. ()
  • Voila, install! .
+6

Source: https://habr.com/ru/post/1668228/


All Articles