Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV installation on windows

I'm trying to install OpenCV on Windows and I followed the Installation by Using git-bash (version>=2.14.1) and cmake (version >=3.9.1) tutorial from the official OpenCV documentation but when I run the build operation I get an error.

I'm using:

  • Windows 10
  • CMake 3.9.1
  • Git Bash 2.17.0
  • TDM64 GCC compiler 5.1.0

Here's the error

In file included from C:\lib\opencv\modules\videoio\src\cap_msmf.cpp:59:0:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/mfplay.h:77:50: error: 'MFP_MEDIAITEM_CHARACTERISTICS' has not been declared
     STDMETHOD_(HRESULT,GetCharacteristics)(THIS_ MFP_MEDIAITEM_CHARACTERISTICS *pCharacteristics) PURE;
                                                  ^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/mfplay.h:79:46: error: 'IMFPMediaPlayer' has not been declared
     STDMETHOD_(HRESULT,GetMediaPlayer)(THIS_ IMFPMediaPlayer **ppMediaPlayer) PURE;

Did someone encounter this kind of error?

like image 895
Salvatore Ucchino Avatar asked Sep 02 '26 16:09

Salvatore Ucchino


1 Answers

Yes I also encountered this error (when compiling with MinGW-w64 gcc 8.1).

For you and anybody else who finds this question when this error occurs (like me), here's what solved the issue for me:

When not using Visual Studio, you have to disable some features which are not supported. Build with cmake options WITH_IPP=OFF and WITH_MSMF=OFF

Solution found on opencv answers: http://answers.opencv.org/question/192758/compile-error-when-compiling-for-windows-341-dev/

like image 158
exomo Avatar answered Sep 05 '26 10:09

exomo