title: OpenCV with Qt: The program has unexpectedly finished
body: <p>I am trying to configure OpenCV with Qt Creator 2.7.0 (Qt 5.0.2) on windows 8 64bit. 
  While executing my program, I get the following error:</p>
  
  <blockquote>
    <p>The program has unexpectedly finished.</p>
  </blockquote>
  
  <p>This is my main.cpp</p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QApplication&gt;
  #include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  
  using namespace cv;
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
      IplImage *image = cvLoadImage("E:\\lena.jpg"); //If this is removed, the program runs OK
      return a.exec();
  }
  </code></pre>
  
  <p>My .pro file is</p>
  
  <pre><code>QT       += core gui
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = untitled1
  TEMPLATE = app
  
  
  SOURCES += main.cpp\
          mainwindow.cpp
  
  HEADERS  += mainwindow.h
  
  FORMS    += mainwindow.ui
  
  unix:!mac {
      message("* Using settings for Unix/Linux.")
      INCLUDEPATH += /usr/local/include/opencv
  
      LIBS += -L/usr/local/lib/ \
          -lopencv_core \
          -lopencv_highgui \
          -lopencv_imgproc
  }
  
  ## OpenCV settings for Mac OS X
  macx {
      message("* Using settings for Mac OS X.")
      INCLUDEPATH += /usr/local/include/opencv
  
      LIBS += -L/usr/local/lib/ \
          -lopencv_core \
          -lopencv_highgui \
          -lopencv_imgproc
  }
  
  ## OpenCV settings for Windows and OpenCV
  win32 {
      message("* Using settings for Windows.")
      INCLUDEPATH += "C:\\OpenCV\\opencv\\build\\include" \
                     "C:\\OpenCV\\opencv\\build\\include\\opencv" \
                     "C:\\OpenCV\\opencv\\build\\include\\opencv2"
  
      LIBS += -L"C:\\OpenCV\\opencv\\build\\x64\\mingw\\lib" \
          -lopencv_core244 \
          -lopencv_highgui244 \
          -lopencv_imgproc244
  }
  </code></pre>
  
  <p>Environment Variables are:</p>
  
  <blockquote>
    <p>OPENCV_DIR:C:\OpenCV\opencv\build\x64\mingw Path:
    G:\5.0.2\Tools\MinGW\bin;G:\Qt\5.0.2\mingw47_32\bin</p>
  </blockquote>
  
  <p>What could be the problem ?</p>