title: Qt Creator + OpenCV: Program runs from .exe but not from editor
body: <p>Well, I need to start working with OpenCV and as I'm used to working with QtCreator, I'm trying to make it all work together. I downloaded the latest OpenCV version, and compiled it with MinGW. Then, I created this little console project to try it out. Below is the <code>.pro</code> file:</p>
  
  <pre><code>QT       += core
  QT       -= gui
  TARGET = OpenCV_test4
  CONFIG   += console
  CONFIG   -= app_bundle
  TEMPLATE = app
  SOURCES += main.cpp
  INCLUDEPATH += C:\\Librerias\\opencv2.3.1\\release\\include
  LIBS += -LC:\\Librerias\\opencv2.3.1\\release\\lib \
      -lopencv_core231.dll \
      -lopencv_highgui231.dll \
      -lopencv_imgproc231.dll \
      -lopencv_features2d231.dll \
      -lopencv_calib3d231.dll
  </code></pre>
  
  <p>Here is the <code>main.cpp</code> file:</p>
  
  <pre><code>#include &lt;QtCore/QCoreApplication&gt;
  #include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  
  int main(int argc, char *argv[])
  {
      QCoreApplication a(argc, argv);
  
      // read an image
      cv::Mat image= cv::imread("img.jpg");
      // create image window named "My Image"
      cv::namedWindow("OpenCV Window");
      // show the image on window
      cv::imshow("OpenCV Window", image);
      // wait key for 5000 ms
      cv::waitKey(5000);
  
      return a.exec();
  }
  </code></pre>
  
  <p>(I have tried this code with and without the <code>QCoreApplication</code> lines)</p>
  
  <p>The deal is: It links and builds, and when runs from QtCreator only a terminal window called <code>C:\QtSDK\QtCreator\bin\qtcreator_process_stub.exe</code> appears with the line <em>"Press RETURN to close this window..."</em></p>
  
  <p>But, if I run the .exe from the project folder, it runs perfectly!! Why is QtCreator unable to launch the application? I found this really strange, and I would appreciate any hint about this. It's really not THAT important, but it is kind of a pain to have to run the .exe manually every time I change something to check how it works.</p>
  
  <p>Thanks for your time :)</p>
  
  <p><strong>Additional Info:</strong> </p>
  
  <ul>
  <li>I have tried both debug and release versions, the problem is the same in both of them.</li>
  <li>Debugging does not work, it never stops at any breakpoint.</li>
  <li>I'm running on Windows 7 Proffesional x64</li>
  </ul>
  
  <hr>
  
  <p>SOLVED, I don't really know what I did, it suddenly worked and keeps working, I wish I could tell you how I fixed it but I have no idea, such a weird thing :(</p>