5

I downloaded the latest OpenCV 2.2 sources for Windows and compiled on Windows XP using MinGW 4.4.1, with the help of CMake 2.8.

Everything went smoothly and compilation (mingw32-make) and installation (mingw32-make install) completed successfully.

However, when I compile some code containing namedWindow() and imshow() functions of highgui, it compiles but the program crashes. The following single line of code crashes:

namedWindow("img", CV_WINDOW_AUTOSIZE);

The sample programs coming with OpenCV, displaying images, also crash.

Have anyone experienced the same problem, and do you have a solution?

I have also compiled and am using OpenCV 2.2 on linux (Ubuntu) without any problem.

Thanks a lot.

Mutebessim
  • 51
  • 1
  • 2
  • Is there a reason that you would like to use OpenCV with MinGW and not Visual Studio? My OpenCV under Visual Studio works just fine. – Dat Chu Feb 11 '11 at 13:13

1 Answers1

4

I've the same problem. I built OpenCV 2.2 under WindowsXP, using CMake, MSYS-make and mingw.

The sollution is explained here: mingw32 SSE/SSE2 instabilities

What I have done is the following:

  1. Use CMake (2.8.4), specify target directory and run "Configure" for MSYS's make.
  2. Type Debug at "CMAKE_BUILD_TYPE".
  3. Remove checkmark for "SSE2".
  4. Run "Configure" again.
  5. Run "Generate".
  6. Run make at target directory.
  7. Run make install.

This worked for me.

Spunc
  • 338
  • 1
  • 14