Display the OpenCV Image with the MinGW compile
===

  I installed the MinGW compile and the OpenCV2.4.0 in the windows7,I write a code of c++,compile and run,but it can't display the Image 

    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>
    using namespace cv; 
    using namespace std;
    {
    Mat im = imread("baboon.jpg
    if (im.empty()) 
      {
          cout << "Cannot open image!" << endl;
          return -1;
      }
    imshow("image", im);
    waitKey(0);
    return 0;
    }

After compile ,everything is ok.the moment you run the loadimg.exe ,It is a black dialog box will pop up, but does not display images，and then loadimg.exe stop working,I know it is the problem of MinGW,check my GCC with gcc -v ,the version is 4.6.2.I can compile the other c++ source and run it Ok,so I don't know what happened and how to do it?