How to solve compile error OpenCV 2.4.10 with MinGW and Visual Studio (11) 2012

asked 2015-02-08 13:43:19 -0500

StefQM gravatar image

I'm one of the many having troubles with compiling OpenCV...

  1. This is what works fine: I can successfully compile the basic OpenCV, using the following guideline ( I'm using newer versions of the tools, but that doesn't seem an issue:

    • OpenCV 2.4.10
    • Cmake 3.1.1 [Visual Studio 11 2012 express compiler], which works with both BUILD_SHARED_LIBS enabled or disabled. I disable ENABLE_SOLUTION_FOLDERS as recommended by the guideline.
    • Visual Studio (11) 2012 for making a 'release' build of ALL_BUILD and INSTALL
  2. This doesn't work: When I redo the above procedure, and simply add OpenNI (WITH_OPENNI) to the Cmake configuration, then I get the following error when compiling ALL_BUILD on the file "XnPlatform.h" on line 58 (project: opencv_highgui):

    Error C1189: #error : Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!

    There seems to be an incompatibility between OpenNI and Visual Studio Exptress newer than 2010 ?

  3. This doesn't work either: In an attempt to get around the above error, I installed Visual Studio 2010, but then I already get an error in CMake... :(

  4. This doesn't work either: (MinGW 3.82.90 attempt) CMake goes well (with MinGW selected as compiler). Then I do "mingw32-make" on the command line, which seems to go fine. Also "mingw32-make install" seems to go fine. Unfortunately, when I run my test-program, it gives an error on the line "import cv2":

    ImportError: DLL load failed: The specified procedure could not be found.

    I added the following to my Path environment value: C:\opencv\build\install\x86\mingw\bin\ ...which is where the dll's were placed by the compilation.

So, now I'm running short on idea's. ...If anyone would have any idea about what could be going wrong ?

edit retag flag offensive close merge delete